Search code examples
iosobjective-cnsurl

How to display data retrieved from NSURLResponse iOS


I am sending a text and retrieving information based on the type of text i used.

I get four responses shown in the NSLog as:

{
    results =     {
        a = "0.2221193444260843";
        b = "0.2331939501178818";
        c = "0.2434309606330154";
        d = "0.3012557448230185";
    };
}

when converting this to a UILabel, i can only get the whole response and not just one response, such as a.

Any method i can do this?


Solution

  • You can access a specific value from your response like so:

    myLabel.text = myResponse[@"results"][@"a"];