Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何检索谷歌日历事件';使用gdata进行描述?_Ios_Iphone - Fatal编程技术网

Ios 如何检索谷歌日历事件';使用gdata进行描述?

Ios 如何检索谷歌日历事件';使用gdata进行描述?,ios,iphone,Ios,Iphone,我使用objective c中的gdata库为iphone应用程序检索google日历事件,我是这样做的 - (void)eventsTicket:(GDataServiceTicket *)ticket finishedWithEntries:(GDataFeedCalendarEvent *)feed error:(NSError *)error { if( !error ){ NSMutableDictionary *dictionary; for( int secti

我使用objective c中的gdata库为iphone应用程序检索google日历事件,我是这样做的

- (void)eventsTicket:(GDataServiceTicket *)ticket finishedWithEntries:(GDataFeedCalendarEvent *)feed error:(NSError *)error
{
  if( !error ){
    NSMutableDictionary *dictionary;
    for( int section=0; section<[data count]; section++ ){
      NSMutableDictionary *nextDictionary = [data objectAtIndex:section];
      GDataServiceTicket *nextTicket = [nextDictionary objectForKey:KEY_TICKET];
      if( nextTicket==ticket ){     // We've found the calendar these events are meant for...
        dictionary = nextDictionary;
        break;
      }
    }

    if( !dictionary )
      return;       // This should never happen.  It means we couldn't find the ticket it relates to.

    int count = [[feed entries] count];  // count for the number of events for the callendar
//099999999999999999999999999999999966666666666666669999999999999999999999999666666666666666699999999999999999999999999999999999999999999999999999999999
    daily_trackAppDelegate *controller =(daily_trackAppDelegate *) [[UIApplication sharedApplication] delegate];


      NSMutableArray *events = [dictionary objectForKey:KEY_EVENTS];
      for( int i=0; i<count; i++ ){
      [events addObject:[[feed entries] objectAtIndex:i]];  //loads the array with events
      }


      for( int i=0; i<count; i++ ){
          NSMutableArray *temporary=[[NSMutableArray alloc]init];

          [temporary removeAllObjects];

          GDataEntryCalendarEvent *event = [events objectAtIndex:i];

        //  [controller.googlearray addObject:event];

          GDataWhen *when = [[event objectsForExtensionClass:[GDataWhen class]] objectAtIndex:0];


          if( when ){
              NSDate *date1 = [[when startTime] date];
              NSDate *date = [date1 dateByAddingTimeInterval:18000.0];
              NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];

              [dateFormatter setDateFormat:@"yy-MM-dd-HH-mm"];
              [temporary addObject:date];///1   date

              NSDate *date11=[[when endTime] date];
              NSDate *date2 = [date11 dateByAddingTimeInterval:18000.0];
             // [controller.array_objject.google_events insertObject:date atIndex:i];///2   date
              [temporary addObject:date2];///1   date

              [dateFormatter release];
          }
          //[controller.array_objject.google_events insertObject:[[event title] stringValue] atIndex:i];  /////3   title
          [temporary addObject:[[event title] stringValue]];///1   date
        GDataWhere *addr = [[event locations] objectAtIndex:0];
          if( addr )
              //[controller.array_objject.google_events insertObject:[addr stringValue] atIndex:i];///// 4   location
              [temporary addObject:[addr stringValue]];
               [controller.googlearray addObject:temporary];///// 4   location

      }
NSURL *nextURL = [[feed nextLink] URL];
    if( nextURL ){    // There are more events in the calendar...  Fetch again.   FETCHING*********************************
      GDataServiceTicket *newTicket = [googleCalendarService fetchFeedWithURL:nextURL delegate:self didFinishSelector:@selector( eventsTicket:finishedWithEntries:error: )];   // Right back here...
      // Update the ticket in the dictionary for the next batch.
      [dictionary setObject:newTicket forKey:KEY_TICKET];
    }
  } else
    [self handleError:error];
}
-(void)eventsTicket:(GDataServiceTicket*)票证已完成,其条目为:(GDataFeedCalendarEvent*)提要错误:(NSError*)错误
{
如果(!错误){
NSMutableDictionary*字典;

对于(int section=0;section事件的描述可以作为[[eventEntry content]stringValue]

使用,谢谢grobbins,但是你能解释一下你的回答吗?很抱歉,我不能完全理解你的建议。谢谢。这是一个有趣的命名方案。content.content。但是它很有效