开发者

Html entities form JSON

开发者 https://www.devze.com 2023-04-06 21:54 出处:网络
In my ifone App, i have called a php page to get contents, it returns JSON format,but the response contains Html entities like ".How i convert these entities to unicode.Any methods or l开发者

In my ifone App, i have called a php page to get contents, it returns JSON format,but the response contains Html entities like ".How i convert these entities to unicode.Any methods or l开发者_高级运维ibraries in objective C.

help is highly appreciated, Shihab.


For your problem you can use SBJSON class and will get result in the dictionary json by following code

NSString *stringResponse = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
SBJSON *jsonParser = [SBJSON new];
NSMutableDictionary *json = [jsonParser objectWithString:stringResponse error:NULL];
0

精彩评论

暂无评论...
验证码 换一张
取 消