iOS-Interview-Questions
iOS-Interview-Questions copied to clipboard
# 8.PerformSelector:afterDelay:这个方法在子线程中是否起作用?
[NSRunLoop.currentRunLoop run];开启runloop后可以用了
- (void)viewDidLoad {
[super viewDidLoad];
queue = dispatch_queue_create("asds", DISPATCH_QUEUE_CONCURRENT);
dispatch_async(queue, ^{
[self performSelector:@selector(testSel:) withObject:@"asdfd" afterDelay:3];
[NSRunLoop.currentRunLoop run];
});
}
- (void)testSel:(id)sender{
NSLog(@"%s=%@",__FUNCTION__,sender);
}