码迷,mamicode.com
首页 > 移动开发 > 详细

iOS 字符串转son  json转字符串

时间:2016-09-26 17:42:53      阅读:385      评论:0      收藏:0      [点我收藏+]

标签:

+ (NSString*)dictionaryToJson:(NSDictionary *)dic
{
    NSError *parseError = nil;
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError];
    return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}
************************************
self.dataDic = [NSDictionarydictionaryWithDictionary:responseData[@"data"]];
            NSString *jsonString = responseData[@"data"][@"visitRemarks"];
            NSError *err;
            NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
            noteArray = [NSJSONSerialization JSONObjectWithData:jsonData  options:NSJSONReadingMutableContainers error:&err];
           

iOS 字符串转son  json转字符串

标签:

原文地址:http://www.cnblogs.com/tian-sun/p/5909945.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!