Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

(C) i3Software 2012

By: a guest on Feb 7th, 2012  |  syntax: Objective C  |  size: 0.73 KB  |  views: 77  |  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. -(void)testFacepunchAPI {
  2.         FPAPI *apiInstance = [FPAPI sharedInstance];
  3.         [apiInstance authenticateWithUsername:@"i300" password:@"colbert2012" andCallbackDelegate:self];
  4. }
  5.  
  6. // Called when Authentication is completed
  7. -(void)facepunchAPIAuthenticationComletedWithPayload:(NSDictionary *)payload {
  8.         FPAPI *apiInstance = [FPAPI sharedInstance];`
  9.         [apiInstance getForumsWithCurrentSessionAndCallbackDelegate:self];
  10. }
  11.  
  12. // Called when GetForums is completed
  13. -(void)facepunchGetForumsCompletedWithForums:(NSArray *)forums {
  14.         FPCategory *firstCategory = [forums objectAtIndex:0];
  15.         NSLog(@"The first category returned by the API is: %@", firstCategory.name);
  16.  
  17.         // Outputs
  18.         // The first category returned by the API is: General Discussion
  19. }