0

Here is the method that I call to create a local calendar titled BART:

- (void)createCalendar
{
    [self setEventStore: [[EKEventStore alloc] init]];

    EKSource *local = nil;

    for (EKSource *source in eventStore.sources){
        if (source.sourceType == EKSourceTypeLocal){
            local = source;
            break;
        }
    }

    NSSet *cals = [local calendars];
    NSLog(@"%@\n",cals);

    [self setBart: [EKCalendar calendarWithEventStore: eventStore]];
    bart.source = local;
    bart.title = @"BART";
    [eventStore saveCalendar:bart commit:YES error:nil];

}

When I test run the program on my iPhone, the calendar does not appear in my iCal, but my output window in Xcode displays that a local source exists and that it contains the calendar that I created. How can I get iCal to display the calendar?

vcsjones
  • 138,677
  • 31
  • 291
  • 286

1 Answers1

0

The iOS Event Kit (Calendar API) allows apps to access event information from a user’s Calendar database.

If you want to display those events in your app, you will have to create your own UIView.

To display the event using the built in "cal app", the user will have to choose to view his calendar himself. You cannot launch it from your app.

Take a look at the following: Does iOS Calendar support a URL scheme? Is there an iPhone URL shortcut for calendar?

Community
  • 1
  • 1
Black Frog
  • 11,595
  • 1
  • 35
  • 66