大佬教程收集整理的这篇文章主要介绍了ios – UIAlertView在完成块中调用时需要很长时间才能显示,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我添加了请求,如果用户选择允许访问,一切都会顺利运行,但如果用户拒绝或先前拒绝访问,则会出现问题.我添加了一个UIAlertView来通知用户访问是否被拒绝,但UIAlertView一直需要20-30秒才会出现,并在此期间完全禁用UI.调试显示[alertView show]在延迟之前运行,即使它在延迟之后实际上没有显示.
[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted,NSError *error) { if (granted) { [self createCalendarEvent]; } else { UIAlertView *alertView = [[UIAlertView alloc] initWithtitle:@"Calendar Access Denied" message:@"Please enable access in Privacy SetTings to use this feature." delegate:nil cancelButtontitle:@"OK" otherButtontitles:nil]; [alertView show]; } }];
[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted,NSError *error) { dispatch_async(dispatch_get_main_queue(),^{ if (granted) { [self createCalendarEvent]; } else { UIAlertView *alertView = [[UIAlertView alloc] initWithtitle:@"Calendar Access Denied" message:@"Please enable access in Privacy SetTings to use this feature." delegate:nil cancelButtontitle:@"OK" otherButtontitles:nil]; [alertView show]; } }); }];
以上是大佬教程为你收集整理的ios – UIAlertView在完成块中调用时需要很长时间才能显示全部内容,希望文章能够帮你解决ios – UIAlertView在完成块中调用时需要很长时间才能显示所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。