[Solved] Show JSON in tableview IOS Xcode [closed]


try this convert the response json into NSDictionary

NSDictionary *receivedDataDic = [NSJSONSerialization JSONObjectWithData:operation.responseObject options:kNilOptions error:&error];

now access the values which you want by using key names , like

NSString * id = [receivedDataDic valueForKey:@"id"];
NSString * name = [receivedDataDic valueForKey:@"name"];

use those variables where you want

make these changes in your code

@interface ViewController ()
{
  NSString * id ,* name;
} 

@property (strong, nonatomic) NSDictionary *posts;
@property (strong, nonatomic) NSMutableArray *post;

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager GET:@"http://api.9292.nl/0.1/locations?lang=nl-NL&q=amsterd" parameters:nil success:^(
       AFHTTPRequestOperation *operation, id responseObject) {

         NSDictionary *receivedDataDic = [NSJSONSerialization JSONObjectWithData:operation.responseObject options:kNilOptions error:&error];

         id = [receivedDataDic valueForKey:@"id"];
         name = [receivedDataDic valueForKey:@"name"];

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Error: %@", error);
    }];

}

solved Show JSON in tableview IOS Xcode [closed]