How to tell 0/1 from false/true with NSJSONSerialization?
I need to deal with JSON data with arbitrary structures in iOS.
However, NSJSONSerialization convert true/false value into NSNumber.
So my question is, how can I tell when a NSNumber is converted from a
boolean value true/false, as apposed to actual number 0/1?
Note: I am aware of [NSNumber numberWithBool], but here, I want to figure
out when it's appropriate to call it. I'm also aware that writing my own
parser solves this problem, but I want to make sure there isn't a easier
solution before I go done that route.
No comments:
Post a Comment