Search code examples
iosobjective-cjsonafnetworkingafjsonrequestoperation

In AFNetworking's JSONRequestOperationWithRequest:success:failure: method, what type of object is the JSON response?


It gives you a variable called JSON of type id, but how do I manipulate this? Is it a string? Do I have to serialize it first? How exactly do I interact with it?


Solution

  • It is returned in the form of dictionary, you just need to extract the value based on the key. Example :

    [JSON valueForKey:@"key"];