{\"id\":2381,\"date\":\"2015-12-13T23:03:37\",\"date_gmt\":\"2015-12-13T15:03:37\",\"guid\":{\"rendered\":\"http://www.test.net/?p=2381\"},\"modified\":\"2015-12-13T23:07:55\",\"modified_gmt\":\"2015-12-13T15:07:55\",\"title\":{\"rendered\":\"Android:第一个Android APP发布\"},\"content\":{\"rendered\":\"你的人生永远不会辜负你的。那些转错的弯,那些走错的路,那些流下的泪水,那些滴下的汗水,那些留下的伤痕,全都让你成为独一无二的自己。by 朱学恒\",\"protected\":false},\"excerpt\":{\"rendered\":\"第一个.. 开源了APP的所有代码[访问地址]. 初试牛刀,学了这么久的Android.总算在磕磕绊绊中完成了 […]\"},\"author\":1,\"featured_media\":0,\"comment_status\":\"open\",\"ping_status\":\"open\",\"wp:term\":[{\"taxonomy\":\"category\",\"href\":\"http://www.text.net/wp-json/wp/v2/categories?post=2381\"},{\"taxonomy\":\"post_tag\",\"href\":\"http://www.text.net/wp-json/wp/v2/tags?post=2381\"}],\"curies\":[{\"name\":\"wp\",\"href\":\"https://api.w.org/{rel}\"}]}}
谢谢

解决方案 »

  1.   

    +(NSDictionary*)dictionaryWithJsonString:(NSString *)string
    {
        if (isBlankString(string)) {
            return nil;
        }
        
        return [NSDictionary dictionaryWithJsonData:[string dataUsingEncoding:NSUTF8StringEncoding]];
    }把你这个字符串传传入这个方法
      

  2.   


    NSString * string = @"{\"id\":2381,\"date\":\"2015-12-13T23:03:37\",\"date_gmt\":\"2015-12-13T15:03:37\",\"guid\":{\"rendered\":\"http://www.test.net/?p=2381\"},\"modified\":\"2015-12-13T23:07:55\",\"modified_gmt\":\"2015-12-13T15:07:55\",\"title\":{\"rendered\":\"Android:第一个Android APP发布\"},\"content\":{\"rendered\":\"你的人生永远不会辜负你的。那些转错的弯,那些走错的路,那些流下的泪水,那些滴下的汗水,那些留下的伤痕,全都让你成为独一无二的自己。by 朱学恒\",\"protected\":false},\"excerpt\":{\"rendered\":\"第一个.. 开源了APP的所有代码[访问地址]. 初试牛刀,学了这么久的Android.总算在磕磕绊绊中完成了 […]\"},\"author\":1,\"featured_media\":0,\"comment_status\":\"open\",\"ping_status\":\"open\",\"wp:term\":[{\"taxonomy\":\"category\",\"href\":\"http://www.text.net/wp-json/wp/v2/categories?post=2381\"},{\"taxonomy\":\"post_tag\",\"href\":\"http://www.text.net/wp-json/wp/v2/tags?post=2381\"}],\"curies\":[{\"name\":\"wp\",\"href\":\"https://api.w.org/{rel}\"}]}";
        
    NSDictionary * dict = [self parseJsonString:string];
    NSLog(@"%@",dict);- (id) parseJsonString:(NSString*)jsonString
    {
        if( jsonString==nil )
            return nil;
        
        NSData * parseData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
        id jsonObject = [NSJSONSerialization JSONObjectWithData:parseData options:NSJSONReadingMutableLeaves error:nil];
        
        return jsonObject;
    }