当我尝试推送我的视图控制器之一时,我收到了错误的访问错误。它是一个随机错误,它有时会发生。我使用了一个类CFRunLoopRun();
,一旦我推送了那个类,那么只会出现这个错误。我正在尝试,但问题仍然没有解决。
让我向您展示我使用过的代码CFRunLoopRun();
。让我知道我是否做错了什么。
bool _WebTryThreadLock(bool), 0xa871560: Multiple locks on web thread not allowed! Please file a bug. Crashing now...
1 0x5068c88 WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*)
2 0x2eb6afe __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
3 0x2eb6a3d __CFRunLoopDoObservers
4 0x2e94704 __CFRunLoopRun
5 0x2e93f44 CFRunLoopRunSpecific
6 0x2e93e1b CFRunLoopRunInMode
7 0x5068c50 RunWebThread(void*)
8 0x9465a5b7 _pthread_start
9 0x94644d4e thread_start
[self fatchAllEvent];
CFRunLoopRun(); // i want to wait until above method get executed
-(void)fatchAllEvent{
events = [[NSMutableArray alloc]init];
eventStore = [[EKEventStore alloc] init];
if ([eventStore respondsToSelector:@selector(requestAccessToEntityType:completion:)])
{
[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error)
{
if (granted)
{
[self performSelectorOnMainThread:@selector(waitAsItoldYou)
withObject:nil
waitUntilDone:YES];
CFRunLoopStop(CFRunLoopGetMain());
// NSLog(@"LOOP has STOP");
}
}];
}
}
其他一切正常,但发生此错误。我已经阅读了人们面临的类似问题的解决方案,但没有一个是有帮助的。任何指针?