码迷,mamicode.com
首页 >  
搜索关键字:performselector    ( 150个结果
performSelector的原理以及用法
一、performSelector调用和直接调用区别下面两段代码都在主线程中运行,我们在看别人代码时会发现有时会直接调用,有时会利用performSelector调用,今天看到有人在问这个问题,我便做一下总结, [delegate imageDownloader:self didFinishWith
分类:其他好文   时间:2016-03-03 11:25:52    阅读次数:171
延时调用
方法1:performSelector [self performSelector:(SEL) withObject:(id) afterDelay:(NSTimeInterval)] --SEL 调用哪个方法 --id 参数 --NSTimeInterval 延时时间 方法2:NSTimer NS
分类:其他好文   时间:2016-02-18 22:43:50    阅读次数:148
performSelector
[self performSelector:@selector(stopLoading) withObject:nil afterDelay:2.0] 此方法表示,会在2s后调用stopLoading方法 参考:http://www.cnblogs.com/buro79xxd/archive/201
分类:其他好文   时间:2016-02-17 18:50:54    阅读次数:125
延时执行方法
self performSelector: withObject: afterDelay:延迟事件再推出viewcontroller时要注意//取消所有延迟事件 [NSObject cancelPreviousPerformRequestsWithTarget:self];
分类:其他好文   时间:2016-01-26 20:17:02    阅读次数:138
iOS多线程开发(三)---Run Loop(二,三)
二,何时使用Run Loop 对于辅助线程,在需要和线程有更多交互时,才使用Run Loop。比如:1)使用端口或者自定义输入源来和其他线程通讯 2)使用线程定时器 3)Cocoa中使用任何performSelector...的方法(参考Table:Performing selectors on o...
分类:移动开发   时间:2016-01-24 00:23:17    阅读次数:185
GCD 续集
1.延迟执行1.1.perform...// 3秒后自动回到当前线程调用 self 的 download: 方法,并且传递参数:@“http://xxx.jpg”[self performSelector:@selector(download:)withObject:@"http://xxx.jpg...
分类:其他好文   时间:2016-01-18 10:34:53    阅读次数:121
常用的延时执行
1、performSelector 一旦定制好延时任务,不会卡住当前线程//2秒后再调用self的run方法[self performSelector:@selector(run) withObject:nil afterDelay:2.0];2、使用GCD函数// 该方法中, 会根据传入的队列来决...
分类:其他好文   时间:2016-01-06 23:23:40    阅读次数:178
IOS中延时执行的几种方式的比较和汇总
本文列举了四种延时执行某函数的方法及其一些区别。假如延时1秒时间执行下面的方法。- (void)delayMethod { NSLog(@"execute"); }1.performSelector方法[self performSelector:@selector(delayMethod) with...
分类:移动开发   时间:2016-01-02 12:07:33    阅读次数:178
延时执行
浅谈iOS开发中方法延迟执行的几种方式字数668 阅读118 评论0 喜欢0 Method1. performSelector方法Method2. NSTimer定时器Method3. NSThread线程的sleepMethod4. GCD公用延迟执行方法- (void)delayMethod{ ...
分类:其他好文   时间:2015-12-26 15:10:55    阅读次数:196
Objective-C响应方法和构造方法
1.响应方法Bool isInstace = [p respondsTosesector:@selector(run)];// 没有参数-(id) performSelector:selector(应用selector指定的方法) NSObject的方法// 一个参数-(id) performSel...
分类:其他好文   时间:2015-12-25 01:11:22    阅读次数:360
150条   上一页 1 ... 4 5 6 7 8 ... 15 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!