title: UiKit should be called from the main thread only warning
body: <p>I am adding an event to a calendar on the click of a button. Whenever I click on that button the Xcode gives me a warning and hangs the app for about few seconds and then add the event into the calendar. the warning is as follows:</p>
  
  <p>void _WebThreadLockFromAnyThread(bool), 0x175bd5c0: Obtaining the web lock from a thread other than the main thread or the web thread. UIKit should not be called from a secondary thread.</p>
  
  <p>the code which I am using for adding the event is as follows:</p>
  
  <pre><code>- (IBAction)btn_reminder_click:(id)sender{
  
      [self addEventTocalendar];
  }
  
  - (void)addEventTocalendar{
      EKEventStore *store = [[EKEventStore alloc] init];
      [store requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
          if (!granted) { return; }
          EKEvent *event = [EKEvent eventWithEventStore:store];
          if (btn_appointment.isSelected) {
              event.title = @"Appointment Reminder.";
          }
          else if (btn_pickup.isSelected){
              event.title  = @"Pickup Reminder";
          }
  
          event.startDate = self.selectedDate;
          event.endDate = [event.startDate dateByAddingTimeInterval:60*60];//set 1 hour meeting
          event.notes = txt_notes.text;
          event.recurrenceRules = EKRecurrenceFrequencyDaily;
          [event addAlarm:[EKAlarm alarmWithRelativeOffset:60.0f * -5.0f]];
          if (selectedIndex == 1) {
              [event addRecurrenceRule:[[EKRecurrenceRule alloc]initRecurrenceWithFrequency:EKRecurrenceFrequencyDaily interval:1 end:Nil]];
  
          }
          else if (selectedIndex == 2){
              [event addRecurrenceRule:[[EKRecurrenceRule alloc]initRecurrenceWithFrequency:EKRecurrenceFrequencyWeekly interval:1 end:Nil]];
          }
          else if (selectedIndex == 3){
              [event addRecurrenceRule:[[EKRecurrenceRule alloc]initRecurrenceWithFrequency:EKRecurrenceFrequencyMonthly interval:1 end:Nil]];
          }
          else if (selectedIndex == 4){
              [event addRecurrenceRule:[[EKRecurrenceRule alloc]initRecurrenceWithFrequency:EKRecurrenceFrequencyYearly interval:1 end:Nil]];
          }
          [event setCalendar:[store defaultCalendarForNewEvents]];
          NSError *err = nil;
          [store saveEvent:event span:EKSpanThisEvent commit:YES error:&amp;err];
          NSString *savedEventId = event.eventIdentifier;  //this is so you can access this event later
          BOOL isSuceess=[store saveEvent:event span:EKSpanThisEvent error:&amp;err];
  
          if(isSuceess){
              UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:@"Event" message:@"Event added in calendar" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
              [alertview show];
  
          }
          else{
              UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:@"Event" message:[err description] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
              [alertview show];
  
          }
      }];
  
  }
  </code></pre>
  
  <p>cam Somebody help me o this as I am not able to solve this problem.</p>