I am using the following code to create an event within the iPhone’s calendar;
EKEvent *event = [EKEvent eventWithEventStore:eventStore];
event.title = @"DHSB Assignment: %@", Assignment1.text;
event.startDate = [[NSDate alloc] init];
event.endDate = [[NSDate alloc] initWithTimeInterval:600 sinceDate:event.startDate];
[event setCalendar:[eventStore defaultCalendarForNewEvents]];
NSError *err;
[eventStore saveEvent:event span:EKSpanThisEvent error:&err];
[EKEventStore release];
NSLog(@"Successfully added '%@' to the calendar", Assignment1.text);
Why is this saving an event with the name “DHSB Assignment: %@” rather than “DHSB Assignment: Example Text”?
Thank you.
Your current code is equivalent to
…which is valid, so it compiles and runs fine even though it isn’t doing what you want.