How do I parse JSON from a file in iOS? [closed]

  1. Create empty text file (New File/Other/Empty) e.g. “example.json”

  2. Paste json string into the file.

  3. Use these lines to get the data:

    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"example" ofType:@"json"];
    NSData *data = [NSData dataWithContentsOfFile:filePath];
    NSArray *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
    

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)