Advertisement
arkader

Get JSON

Jun 22nd, 2012
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Get JSOn
  2.     NSURL *url = [NSURL URLWithString:@"http://hive-concept.com/web/app_dev.php/get/drinks"];
  3.     NSURLRequest *request = [NSURLRequest requestWithURL:url];
  4.     AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
  5.      
  6.         NSLog(@"%@",[[[JSON objectAtIndex:0] objectForKey:@"cocktail"] objectForKey:@"name"]);
  7.         NSLog(@"class : %@",[JSON class]);
  8.        
  9.        
  10.         NSDictionary *data = (NSDictionary *)JSON;
  11.         _drinksData = [[NSDictionary alloc] initWithDictionary:data];
  12.         NSLog(@"drinksData %@",_drinksData);
  13.  
  14.     } failure:nil];
  15.     [operation start];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement