2014-06-25 83 views
1

我正在嘗試基於日曆事件開發ios應用程序。我使用GData獲取日曆事件。我沒有得到如何從日曆事件輸出下方獲取事件標題和時間的值?從日曆事件中獲取事件標題和時間

calendar events (
"GDataEntryCalendarEvent 0x175c6340: {v:2.6 **title**:Meeting at 11am. content: etag:\"GU4MQwRJeSp7JGA6WhNQ\" kind:calendar#event authors:1 categories:1 links:alternate,self,edit edited:2014-06-25T07:21:27Z id:some value visibility:event.default transparency:event.opaque eventStatus:event.confirmed **times**:(2014-06-26T00:00:00+05:30..2014-06-26T01:00:00+05:30) reminders:1 comment iCalUID:[email protected] sequenceNumber:0 guestsCanInvite:YES guestsCanSeeGuests:YES unparsed:<gCal:videoConference>}", 
"GDataEntryCalendarEvent 0x175d6e30: {v:2.6 **title**:Lunch content: etag:\"GU4MQwNCeip7JGA6WhNQ\" kind:calendar#event authors:1 categories:1 links:alternate,self,edit edited:2014-06-25T07:32:14Z id:some value visibility:event.default transparency:event.opaque eventStatus:event.confirmed **times**:(2014-06-27T13:30:00+05:30..2014-06-27T14:30:00+05:30) reminders:1 comment iCalUID:[email protected] sequenceNumber:0 guestsCanInvite:YES guestsCanSeeGuests:YES unparsed:<gCal:videoConference>}" 

回答

0

試試這個

for (GDataEntryCalendarEvent *event in yourEventEntries) { 

    NSString *title = [[event title] stringValue]; 
    NSLog(@"Title : %@",title); 

    NSArray *times = [event times]; 
    NSLog(@"times : %@",times); 


    GDataDateTime *startTime = nil; 
    GDataDateTime *endTime = nil; 

    GDataWhen *when = nil; 
    if ([times count] > 0) { 
     when = [times objectAtIndex:0]; 
     startTime = [when startTime]; 
     endTime = [when endTime]; 
    } 
}