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

前端 未结 6 762
时光取名叫无心
时光取名叫无心 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:21

    You have to add JSON framework which is parse string into NSDictionary. Use zip file from here

    1. Open Folder and rename Classes folder to "JSON".
    2. Copy JSON Folder and include in your project.
    3. Import header file like below in controller where you want to parse JSON String.

      #import "SBJSON.h"
      #import "NSString+SBJSON.h"
      
    4. Now, Parse your response string in to NSDictionary like below.

      NSMutableDictionary *dictResponse = [strResponse JSONValue];
      

提交回复
热议问题