[英]Why use dispatch_async when using performSegueWithIdentifier in requestAccessToEntity:completion?
当我在完成块中调用performSegueWithIdentifier时,如果我没有将调用包装在dispatch_async中,则实际发生segue需要10秒钟。 但是,我可以做其他事情而不将它们包装在同一个dispatch_async中,例如进行核心数据工作,或者记录“事物”......
任何关于这如何工作的原因以及为什么......我迷失了。 如果这不是问这样的事的正确的地方,我道歉。
EKEventStore *store = [[EKEventStore alloc] init];
[store requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[self performSegueWithIdentifier:self.phaseSegue sender:self];
});
}];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.