2012-05-22 24 views
1

我期待通過iOS上的Facebook API Graph增加登記入住人數。如何使用iOS上的Facebook API Graph增加登記入住人數

我正在使用Hackbook示例,目前只有5個地方需要檢查顯示在UITableView中。

下面的方法有距離參數,但我找不到的地方返回籤號......

/* 
* Graph API: Search query to get nearby location. 
*/ 
- (void)apiGraphSearchPlace:(CLLocation *)location { 
    [self showActivityIndicator]; 
    currentAPICall = kAPIGraphSearchPlace; 
    NSString *centerLocation = [[NSString alloc] initWithFormat:@"%f,%f", 
           location.coordinate.latitude, 
           location.coordinate.longitude]; 
    HackbookAppDelegate *delegate = (HackbookAppDelegate *)[[UIApplication sharedApplication] delegate]; 
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
            @"place", @"type", 
            centerLocation, @"center", 
            @"3000", @"distance", 
            nil]; 
    [centerLocation release]; 
    [[delegate facebook] requestWithGraphPath:@"search" andParams:params andDelegate:self]; 
} 

如果有人知道如何做到這一點,請讓我知道。

感謝

回答

1

好吧,我發現它在- (void)request:(FBRequest *)request didLoad:(id)result方法:

case kAPIGraphSearchPlace: 
     { 
      NSMutableArray *places = [[NSMutableArray alloc] initWithCapacity:1]; 
      NSArray *resultData = [result objectForKey:@"data"]; 
      for (NSUInteger i=0; i<[resultData count] && i < 15; i++) { 
       [places addObject:[resultData objectAtIndex:i]]; 
      } 
      // Show the places nearby in a new view controller 
      APIResultsViewController *controller = [[APIResultsViewController alloc] 
               initWithTitle:@"Check In" 
               data:places 
               action:@"places"]; 
      [self.navigationController pushViewController:controller animated:YES]; 
      [controller release]; 
      [places release]; 
      break; 
     } 
相關問題