Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. NSMutableDictionary* params = [NSMutableDictionary NictionaryWithObjectsAndKeys:_facebook.accessToken,@"access_token",nil];
  2. [_facebook requestWithGraphPath:@"me/albums" andParams:params andDelegate:self];
  3.  
  4. NSURL *url1 = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/photos&access_token=AAACeFkezepQBANpoFq9I3Hts0JdE6Xis3UpZBqNxpgw62zWSlhSYyYcluGaaxH3IlKIh9w8OYrXYF9MsAxhk6ta1ANZClCaznpdSaERgZDZD",A_ID]];
  5. URLWithString:@"https://graph.facebook.com/114750591966408/photos&access_token=//AAACeFkezepQBANpoFq9I3Hts0JdE6Xis3UyYcluGaaxH3IlKIh9w8OYrXYF9MsAxhk6ta1ANZClCaznpdSaERgZDZD"];
  6. NSData *data1 = [NSData dataWithContentsOfURL:url1];
  7. NSString *str1=[[NSString alloc] initWithData:data1 encoding:NSASCIIStringEncoding];
  8. // NSString *str1=[[NSString alloc]ini]
  9. NSDictionary *userData1 = [str1 JSONValue];
  10. NSArray *arrOfimages=[userData1 objectForKey:@"data"];
  11. NSMutableArray *sourceUrls = [[NSMutableArray alloc] initWithCapacity:0];
  12.  
  13. for(NSDictionary *subDictionary in arrOfimages)
  14. {
  15.  
  16. [sourceUrls addObject:[subDictionary objectForKey:@"picture"]];
  17.  
  18. }
  19.  
  20. [FBRequestConnection startWithGraphPath:@"me/albums"
  21. completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
  22. if (!error) {
  23. // Success! Include your code to handle the results here
  24. NSLog(@"user events: %@", result);
  25. NSArray *feed =[result objectForKey:@"data"];
  26.  
  27. for (NSDictionary *dict in feed) {
  28.  
  29. NSLog(@"first %@",dict);
  30.  
  31. }
  32. } else {
  33. // An error occurred, we need to handle the error
  34. // Check out our error handling guide: https://developers.facebook.com/docs/ios/errors/
  35. NSLog(@"error %@", error.description);
  36. }
  37. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement