title: eventkit and add event into calender from app
body: <p>i want to ask that i need to add event from my app and i select date from date picker and write event in text box and it hit in the calender ,default calender of iphone how could i do this
  is use framework eventkit</p>
  
  <p>i use this code but not working </p>
  
  <pre><code>- (void)viewDidLoad
  {
      self.eventStore = [[EKEventStore alloc] init];
  
      self.eventsList = [[NSMutableArray alloc] initWithArray:0];
  
      // Get the default calendar from store.
      self.defaultCalendar = [self.eventStore defaultCalendarForNewEvents];
  
      // create an Add button
      UIBarButtonItem *addButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"bell.png" ] style:UIBarButtonItemStylePlain target:self action:@selector(addEvent:)];
      //UIBarButtonItem *addButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(addEvent:)];
      self.navigationItem.rightBarButtonItem = addButtonItem;
      [addButtonItem release];
  
      [super viewDidLoad];
  }
  
  -(IBAction) addEvent:(id)sender 
  {   
      self.eventStore = [[EKEventStore alloc] init];
      EKEvent *event = [EKEvent eventWithEventStore:eventStore];
      //  event.title =@"Whatever you want your title to be";
      event.title = @"a";
  
      //    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  
      event.allDay = YES;
  
      EKEventEditViewController *addController = [[EKEventEditViewController alloc] initWithNibName:nil bundle:nil];
      addController.event = event;
      addController.eventStore = self.eventStore;
      [self presentModalViewController:addController animated:YES];
  
      addController.editViewDelegate = self;
      [addController release];   
  }
  </code></pre>