title: Objective C- iCal not creating custom calendar and new event to it in iOS 9
body: <p>This working perfectly in iOS 8.</p>
  
  <p>But creating issue in iOS 9.Here is code :</p>
  
  <pre><code>self.eventManager.eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
          if (granted) {
  
              // Create a new calendar.
              EKCalendar *calendar = [EKCalendar calendarForEntityType:EKEntityTypeEvent
                                                            eventStore:self.eventManager.eventStore];
  
              // Set the calendar title.
              calendar.title = @"&lt;APP name&gt;";
              calendar.CGColor=APP_Blue_COLOR.CGColor;
  
              // Find the proper source type value.
              for (int i=0; i&lt;self.eventManager.eventStore.sources.count; i++) {
                  EKSource *source = (EKSource *)[self.eventManager.eventStore.sources objectAtIndex:i];
                  EKSourceType currentSourceType = source.sourceType;
  
                  if (currentSourceType == EKSourceTypeLocal) {
                      calendar.source = source;
                      break;
                  }
              }
  
  
              // Save and commit the calendar.
              NSError *error;
              [self.eventManager.eventStore saveCalendar:calendar commit:YES error:&amp;error];
  
              // If no error occurs then turn the editing mode off, store the new calendar identifier and reload the calendars.
              if (error == nil) {
                  // Turn off the edit mode.
                  // Store the calendar identifier.
                  [self.eventManager saveCustomCalendarIdentifier:calendar.calendarIdentifier];self.eventManager.selectedCalendarIdentifier=calendar.calendarIdentifier;//chirag
  
              }
              else{
                  // Display the error description to the debugger.
                  NSLog(@"CREATE_CALENDER %@", [error localizedDescription]);
              }
  
          }
          else
          {
  
              UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"" message:@"Please give permission to access your iPhone calender." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil];
              [alert show];
  
  
          }
  
      }];
  </code></pre>
  
  <p>It give me success message but not creating my app calendar in iPhone calendar.</p>
  
  <p>I though that it does not showing it due to no event set to it.so I also tried to set new event.</p>
  
  <p>But it give me following code &amp; error while creating new event.</p>
  
  <pre><code>// Create a new event object.
      EKEvent *event = [EKEvent eventWithEventStore:self.eventManager.eventStore];
  
      // Set the event title.
      event.title = title;
  
      // Set its calendar.
      event.calendar = [self.eventManager.eventStore calendarWithIdentifier:self.eventManager.selectedCalendarIdentifier];
  
      // Set the start and end dates to the event.
      event.startDate = startDate;
      event.endDate = endDate;
   // Save and commit the event.
      NSError *error;
      if ([self.eventManager.eventStore saveEvent:event span:EKSpanThisEvent commit:YES error:&amp;error]) {
          // Call the delegate method to notify the caller class (the ViewController class) that the event was saved.
          return true;
      }
      else{
          // An error occurred, so log the error description.
          NSLog(@"%@", [error localizedDescription]);
      return false;
      }
  </code></pre>
  
  <p>It give following error internally however it return will in NSError object:</p>
  
  <pre><code>Error getting shared calendar invitations for entity types 3 from daemon: Error Domain=EKCADErrorDomain Code=1014 "(null)"
  </code></pre>