简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM