How can i fetch value from Json response in Objective -C

前端 未结 6 775
时光取名叫无心
时光取名叫无心 2021-02-11 11:40

I have a problem with fetching data from Json response.

Here is an example data structure :

(
     {
        AT = \"\";
        DId = 0;
            


        
6条回答
  •  眼角桃花
    2021-02-11 12:29

    Use following method:
    
    
    NSDictionary *mainDict;
    SBJSON *jsonParser = [[SBJSON alloc]init];
        if([[jsonParser objectWithString:responseString] isKindOfClass:[NSDictionary class]])
        {
            mainDict=[[NSDictionary alloc]initWithDictionary:[jsonParser objectWithString:responseString]];
        }
    
    NSDictionary *firstDict=[NSDictionary alloc]initWithDictionary:[mainDict valueForKey:@""];
    

提交回复
热议问题