title: Creating new event in iOS5 Calendar by opening an iCalendar (.ics) file
body: <p>According to <a href="http://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-4_2/_index.html" rel="noreferrer">Apple's iOS 4.2 release notes</a>:</p>
  
  <blockquote>
    <p>Calendar can now import .ics files directly as a way to add events. If
    your app has access to .ics files, you should test importing them
    using the UIDocumentInteractionController API.</p>
  </blockquote>
  
  <p>I'm opening a sample <code>.ics</code> file using <code>UIDocumentInteractionController</code> and the iOS Calendar app appears, but it hasn't created a new appointment -- it just shows whatever it was showing when the Calendar app was last used. Has anyone had any luck with creating new events this way?</p>
  
  <p>My code for the <code>UIDocumentInteractionController</code> usage is:</p>
  
  <pre><code>- (void)openDocumentIn {    
      NSString * filePath = 
      [[NSBundle mainBundle] 
       pathForResource:@"testevent" ofType:@"ics"];    
  
      self.documentController = 
          [UIDocumentInteractionController 
           interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];
  
      self.documentController.delegate = self;
  
      [self.documentController presentOpenInMenuFromRect:CGRectZero
                                             inView:self.view 
                                           animated:YES];
  }
  </code></pre>
  
  <p>And my sample <code>.ics</code> file:</p>
  
  <pre><code>BEGIN:VCALENDAR
  VERSION:1.0
  BEGIN:VEVENT
  DTSTART:20120411T090000
  DTEND:20120411T100000
  SUMMARY:Crazy party
  LOCATION:Windsor Bouncy Castle
  DESCRIPTION:Lots of good stuff will happen.
  PRIORITY:3
  END:VEVENT
  END:VCALENDAR
  </code></pre>
  
  <p>I'm running iOS 5.1 on an original iPad.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I've tried pre-creating an event in my Calendar that matches the time/data of the <code>.ical</code> event, to see if in this case the Calendar app would at least show the already existing  event that matches, but again no luck - the calendar app just opens showing whatever was showing last time.</p>