I am adding calendar appointments to the native iOS calendar by retrieving XML data from a database. The XML data is similar to this.
<street>509 NORTH 44TH</street>
<street>4107 BLOSSUMWOOD DR</street>
I am wanting to use the date, start time and end time to set the appointment and use the address as the title.
My Xcode looks like this. I have commented the sections I need populated from XML.
today = [NSDate date];
messageDate = date;
store=[[EKEventStore alloc] init];
EKEvent *addEvent=[EKEvent eventWithEventStore:store];
addEvent.title=@"1202 Test Way";//needs to be street from XML.
addEvent.startDate=today;//needs to be date and starttime from XML.
addEvent.endDate=today;//needs to be date and endtime from XML.
[addEvent setCalendar:[store defaultCalendarForNewEvents]];
addEvent.alarms=[NSArray arrayWithObject:[EKAlarm alarmWithAbsoluteDate:addEvent.startDate]];
[store saveEvent:addEvent span:EKSpanThisEvent error:nil];