ios json

NSString *strr = @"{\"cityName\":\"市\"}";

    NSError *er = nil;
    id js = [NSJSONSerialization JSONObjectWithData:[strr dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers | NSJSONReadingMutableLeaves error:&er];
    NSLog(@" %@ ", [js objectForKey:@"cityName"]);

你可能感兴趣的:(json)