在公司做蓝牙项目的时候,关于打开蓝牙提示框的问题 。第一次运行没问题,跳到另一个视图上面,同样运行取消视图就会崩溃的问题。
具体崩溃的方法如下
- (void)setFadeOutTimer:(NSTimer *)newTimer {
if(fadeOutTimer)
[fadeOutTimer invalidate];
fadeOutTimer = nil;
if(ne...
分类:
其他好文 时间:
2015-07-08 16:33:07
阅读次数:
236
本文转载至myTimer=[NSTimerscheduledTimerWithTimeInterval:1.5target:selfselector:@selector(scrollTimer)userInfo:nilrepeats:NO];//不重复,只调用一次。timer运行一次就会自动停止运行...
分类:
移动开发 时间:
2015-07-02 22:15:57
阅读次数:
202
1.使用NSTimer 来实现[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(setNeedsDisplay) userInfo:nil repeats:YES];2.使用CADisplayLin...
分类:
移动开发 时间:
2015-07-02 13:59:58
阅读次数:
131
NStimer是ios开发的计时器,简单易用,但有几个注意事项1. 创建NStimer的两个常用方法是+ (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector us...
分类:
移动开发 时间:
2015-07-01 23:34:17
阅读次数:
195
定义:循环引用可以简单理解为A引用了B,而B又引用了A,双方都同时保持对方的一个引用,导致任何时候引用计数都不为0,始终无法释放;造成循环引用的三种情况计时器NSTimer原因分析:NSTimer变量通过target对xxxModel有强引用,NSTimer变量是xxxModel内部的成员变量,所以...
分类:
其他好文 时间:
2015-06-29 06:27:47
阅读次数:
378
1.时间控制器 但是需要注意只能在主线程中使用[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(logBtnClick) userInfo:nil repeats:YES];2.延迟调用[self pe....
分类:
其他好文 时间:
2015-06-24 09:19:08
阅读次数:
136
最近在使用selector时经常思考的问题,
给UIButton 添加点击事件,可以在selector后加“:”将button作为参数传入方法中,
今天用
[NSTimer
scheduledTimerWithTimeInterval:1
target:self
selector:@selector(rotateAction:)
userInfo:nil
repeats:NO];
...
分类:
移动开发 时间:
2015-06-21 18:38:07
阅读次数:
145
计时器可以指定绝对的日期和时间,以便到时执行任务也可以指定执行的任务的相对延迟时间,还可以重复运行任务。计时器要和runloop相关联,运行循环到时候会触发任务。虾米昂这个方法可以创建并预先安排到当前运行循环中:+ (NSTimer *)scheduledTimerWithTimeInterva.....
分类:
其他好文 时间:
2015-06-20 15:33:02
阅读次数:
232
可以有两个办法让NSURLConnection在子线程中运行,即将NSURLConnection加入到run loop或者NSOperationQueue中去运行。前面提到可以将NSTimer手动加入NSRunLoop,Cocoa库也为其它一些类提供了可以手动加入NSRunLoop的方法,这些类有N...
分类:
编程语言 时间:
2015-06-19 18:06:19
阅读次数:
175
创建一个 Timer+scheduledTimerWithTimeInterval: invocation: repeats:+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti invocation:(NSInvocatio....
分类:
其他好文 时间:
2015-06-15 23:27:04
阅读次数:
175