I just try to use JSON for the first time. But my data is japanese but it show in cell in UTF format (\u358\u798\u789 Blah Blah Blah)
please take a look to my code.
NSError *theError = nil;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.blahblah.com"]];
NSURLResponse *theResponse =[[NSURLResponse alloc]init];
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&theResponse error:&theError];
NSMutableString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//NSDictionary *jsonDictionaryResponse = [string JSONValue];
self.city = [NSMutableArray arrayWithArray:[string componentsSeparatedByString:@"\""]];
What can dictionary and JSONValue do ?
How can I show it in japanese ? Am I wrong in encoding ?
very thank for you help ?
you have to parse your json file first. Main JSON parsing libraries for Objective-C are:
so first, parse you JSON file, then assign the value to self.city (I don’t see any other error).