Ian Livingstone
Ian Livingstone

Reputation: 261

Objective-C JSON Boolean

I have parsed a json object that has the following structure:

{
    data = "<null>";
    "error_type" = "INPUT_ERROR";
    msg = "Missing field parameter";
    success = 0;
}

I'm trying to do a compariosn to see whether success is true or false, however it dosnt work and gives me a warning saying you can't compare a pointer as a integer. I've also tried NO and YES.

Anyhelp would be greatly appreciated.

Upvotes: 2

Views: 2656

Answers (1)

James J
James J

Reputation: 6458

I believe success is likely being cast to a NSNumber. Try [success boolValue].

Upvotes: 11

Related Questions