[iOS]字符串转字典

有点时候,我们json中有post请求的网址,这个时候我们须要把网址字符串转换成body体 字典   放在post请求中



    NSString *body = [self.url_C_ componentsSeparatedByString:@"="].lastObject;

    NSData *data = [body dataUsingEncoding:NSUTF8StringEncoding];

    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];


posted @ 2017-06-23 20:15  yangykaifa  阅读(466)  评论(0)    收藏  举报