I am using iOS 5 new feature to parse JSON and I have no idea that why I am not getting any key value pairs. "aStr" (string representation of data) is putting the right JSON on the output window but I am getting nothing in "dicData" and there is no error either.
Any help is greatly appreciated.
This is what I am using
NSError *error = nil;
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.macscandal.com/?json=get_post&post_id=436"]];
NSString* aStr;
aStr = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
//NSLog(@"data = %@",aStr);
NSDictionary *dicData = [NSJSONSerialization
JSONObjectWithData:data
options:NSJSONReadingAllowFragments
error:&error];
//NSLog(@"error = %@",error);
NSString *title = [dicData objectForKey:@"title"];