0

This is my scenario:

I am adding an event to iOS calender from my app. Just before adding the event (add event view of calendar is being shown ), if user go to settings-->general-->restrictions-->calendar and restrict my app's permission the app crashes.

Have anyone came across an issue like this? Any leads? because xcode isn't giving any relates log while crashing. I am running app in iOS 6.0 iPod Touch.

Hope some can help.

Deepukjayan
  • 3,525
  • 1
  • 20
  • 31

1 Answers1

0

First get permission to access calendar events and then add event. Code to get permission

EKEventStore eventStore = [[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)
Payal
  • 116
  • 3