- (BOOL)transitionToNextPhase
{ // 保证代码在主线程
if (![[NSThread currentThread] isMainThread])
{
dispatch_sync(dispatch_get_main_queue(),^{
[self transitionToNextPhase];
});
return YES;
}
//后续执行代码
}
- (BOOL)transitionToNextPhase
{ // 保证代码在主线程
if (![[NSThread currentThread] isMainThread])
{
dispatch_sync(dispatch_get_main_queue(),^{
[self transitionToNextPhase];
});
return YES;
}
//后续执行代码
}
转载于:https://www.cnblogs.com/shengzaiwen/p/6649715.html