标签:应用 nil token pat dispatch static source bsp and
//使用该方法,可以更新UI、查询类的属性,甚至是执行方法,所有这一切都不需要重启应用病达到某个特定的工作状态,相当优美。
//1
#if DEBUG
//2
dispatch_queue_t queue = dispatch_get_main_queue();
//3
static dispatch_source_t source = nil;
//4
__typeof(self) __weak weakself = self;
//5
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
//6
source = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGSTOP, 0, queue);
//7
if (source) {
//8
dispatch_source_set_event_handler(source, ^{
//9
NSLog(@"%@ Hi I am",weakself);
});
//10
dispatch_resume(source);
}
});
#endif
标签:应用 nil token pat dispatch static source bsp and
原文地址:http://www.cnblogs.com/encoreMiao/p/6623031.html