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

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

    I think what you require here is to understand what a JSON response is rather than the Answer to get the values of some objects from your JSON response.

    If you want some detail explanation about JSON Parsing then you can take a look at NSJSONSerialization Class Reference. Everything is given there or you can take a look at my Answer.


    Understand the Concept. It depends on what you have inside your JSON. If it's an Array ( Values inside [ ]) then you have to save in NSArray, if it's a Dictionary ( Values inside { }) then save as NSDictionary and if you have single values like string , integer, double then you have to save them using appropriate Objective-C Data types.

    For some simple details with example , you can check my Answer from this question.

提交回复
热议问题