Ios6 iOS日历限制导致应用程序崩溃

Ios6 iOS日历限制导致应用程序崩溃,ios6,calendar,settings,ipod-touch,restrictions,Ios6,Calendar,Settings,Ipod Touch,Restrictions,这是我的设想: 我正在从我的应用程序向iOS日历添加事件。在添加事件之前(显示日历的添加事件视图),如果用户转到设置-->常规-->限制-->日历并限制我的应用程序的权限,则应用程序将崩溃 有没有人遇到过这样的问题?有线索吗?因为xcode在崩溃时没有给出任何日志。我正在用iOS 6.0 iPod Touch运行应用程序 希望有人能提供帮助。首先获得访问日历事件的权限,然后添加事件。 获取权限的代码 EKEventStore事件存储=[[EKEventStore alloc]init] if (

这是我的设想:

我正在从我的应用程序向iOS日历添加事件。在添加事件之前(显示日历的添加事件视图),如果用户转到设置-->常规-->限制-->日历并限制我的应用程序的权限,则应用程序将崩溃

有没有人遇到过这样的问题?有线索吗?因为xcode在崩溃时没有给出任何日志。我正在用iOS 6.0 iPod Touch运行应用程序


希望有人能提供帮助。

首先获得访问日历事件的权限,然后添加事件。 获取权限的代码

EKEventStore事件存储=[[EKEventStore alloc]init]

if ([eventStore respondsToSelector:@selector(requestAccessToEntityType:completion:)])
{
    [eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error)
     {
         if (granted){

             MLLog(@"Wipe : getEventStorePermission : permission granted");
         }
         else{
             MLLog(@"Wipe : getEventStorePermission : permission not granted");
         }
     }];
}
else{

    MLLog(@"Wipe : getEventStorePermission : permission not required");
}

RELEASE_OBJECT(eventStore)