Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 1.33 KB  |  hits: 62  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. FQL in the SDK 3.0 Beta for iOS
  2. [[[FBRequest alloc] initWithSession:...
  3.                          restMethod:...
  4.                          parameters:...
  5.                          HTTPMethod:...]
  6.  startWithCompletionHandler:...];
  7.        
  8. FBRequest *fql = [FBRequest requestForGraphPath:@"fql"];
  9. [fql.parameters setObject:@"SELECT uid, name, pic_square FROM user WHERE uid = me()"
  10.                           @"OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me())"
  11.                    forKey:@"q"];
  12.  
  13. [fql startWithCompletionHandler:^(FBRequestConnection *connection,
  14.                                   id result,
  15.                                   NSError *error) {
  16.     if (result) {
  17.         NSLog(@"result:%@", result);
  18.     }
  19. }];
  20.        
  21. FBRequestConnection *conn = [[FBRequestConnection alloc] init];
  22. [conn addRequest:fqlRequest1 completionHandler:^(FBRequestConnection *connection,
  23.                                                  id result,
  24.                                                  NSError *error) {
  25.     if (result) {
  26.         NSLog(@"result:%@", result);
  27.     }
  28. }];
  29.  
  30. [conn addRequest:fqlRequest2 completionHandler:^(FBRequestConnection *connection,
  31.                                                  id result,
  32.                                                  NSError *error) {
  33.     if (result) {
  34.         NSLog(@"result:%@", result);
  35.     }
  36. }];
  37.  
  38. [conn start];