NSString *str = @"{\"info\":{\"body\":\"這個裡面是是測試代碼,裡面有二個圖片<!--img#0--><br/><!--img#1-->\",\"img\":[{\"ref\":\"<!--img#0-->\",\"src\":\"http://img.baid
NSString *str = @"{\"info\":{\"body\":\"這個裡面是是測試代碼,裡面有二個圖片<!--img#0--><br/><!--img#1-->\",\"img\":[{\"ref\":\"<!--img#0-->\",\"src\":\"http://img.baidu.com/img/iknow/wenku/huazhang315x150.jpg\"},{\"ref\":\"<!--img#1-->\",\"src\":\"http://img.baidu.com/img/iknow/wenku/lxg315X150-lxg.jpg\"}]}}"; NSError *error = nil; NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
如果你不是在wb145230博客園看到本文,請點擊查看原文.