How to convert JSON serialized data to NSDictionary

前端 未结 5 583
小鲜肉
小鲜肉 2020-12-02 14:28

I have used this method,

NSDictionary *jsonObject=[NSJSONSerialization 
       JSONObjectWithData:jsonData 
                  options:NSJSONReadingMutableLea         


        
5条回答
  •  醉话见心
    2020-12-02 14:43

    Please Try the following Code.

    NSError* error;
    NSDictionary* json = [NSJSONSerialization JSONObjectWithData:responseData
                                                         options:kNilOptions 
                                                           error:&error];
    
    NSArray* latestLoans = [json objectForKey:@"loans"];
    
    NSLog(@"loans: %@", latestLoans);
    

提交回复
热议问题