解决办法:
1, 使用GCD用主线程跳转
dispatch_async(dispatch_get_main_queue(), ^{
//跳转代码
...
});
2, 召唤主线程, 使用performSelector在主线程随便执行一个方法
[self performSelector:@selector(anyMethod) onThread:[NSThread mainThread] withObject:nil waitUntilDone:NO];
解决办法:
1, 使用GCD用主线程跳转
dispatch_async(dispatch_get_main_queue(), ^{
//跳转代码
...
});
2, 召唤主线程, 使用performSelector在主线程随便执行一个方法
[self performSelector:@selector(anyMethod) onThread:[NSThread mainThread] withObject:nil waitUntilDone:NO];