首页 > 代码库 > 字典类型的字符串转成字典

字典类型的字符串转成字典

字典类型的字符串转成字典

 

技术分享

- (NSDictionary *)parseJSONStringToNSDictionary:(NSString *)JSONString {
    NSData *JSONData = http://www.mamicode.com/[JSONString dataUsingEncoding:NSUTF8StringEncoding];
    NSDictionary *responseJSON = [NSJSONSerialization JSONObjectWithData:JSONData options:NSJSONReadingMutableLeaves error:nil];
    return responseJSON;
}

 

字典类型的字符串转成字典