- (void)viewDidLoad {
NSLog(@"1");
[super viewDidLoad];
//不阻塞当前主线程执行
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"3");
});
NSLog(@"2");
}
打印按1-2-3顺序
- (void)viewDidLoad {
NSLog(@"1");
[super viewDidLoad];
//不阻塞当前主线程执行
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"3");
});
NSLog(@"2");
}
打印按1-2-3顺序