So i have gotten my Json data in which i have got:
{
"name": "brad"
}
I am trying to store that individual name as a string.
@try
{
NSError *error;
NSString *url_string = [NSString stringWithFormat: @"http://Share/scripts/newjson.json"];
///Dummy URL
NSData *data = [NSData dataWithContentsOfURL: [NSURL URLWithString:url_string]];
NSMutableArray *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
NSLog(@"json: %@", json);
}
@catch (NSException *e)
{
NSLog(@"Internet not enabled");
//something went wrong
//populate the NSError object so it can be accessed
}
But when i print out the json file i just get what is shown above, do i need to use a delimiter or something to get this string ?
Thanks