I just try to deploy client server apps in Objective-C. I get an json string like this from server when I make a query:
@"{"url":"http://my-company.com/json"}".
How do I extract the http://my-company.com/json directly using Objective C?
Read more about NSJSONSerialization
NSString *jsonString = @"{\"url\":\"http://my-company.com/json\"}";
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSError *e;
NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&e];
NSString *url = [jsonDict objectForKey:@"url"];
NSLog(@"url: %@", url);
e and take an error path.