Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSNull -> nil #7

Closed
samvermette opened this issue Mar 10, 2011 · 3 comments
Closed

NSNull -> nil #7

samvermette opened this issue Mar 10, 2011 · 3 comments

Comments

@samvermette
Copy link

Any plan on supporting this like TouchJSON and other parsers do? For now I've added an NSDictionary category that checks for null values and return nil instead. I've tried adding that directly to the parser but that code is way beyond my knowledge ^^

@johnezang
Copy link
Owner

No. That isn't a feature, it's a bug. If TouchJSON is actually doing that, you should file a bug with that project NSNull is != to nil for a very, _very_ good reason, and you should never treat it as if it was ==.

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/NumbersandValues/Articles/Null.html%23//apple_ref/doc/uid/TP40005153-SW1

@ghost ghost assigned johnezang May 21, 2011
@odyth
Copy link

odyth commented Dec 28, 2012

@johnezang, I disagree that it is a bug. While NSNull is not equal to nil, they both mean the absence of a value. A convenience of omitting them from the decoded dictionary is that you dont have to do both an Object comparison as well as a nil comparison to ensure your value is not in the dictionary.

@drunkhacker
Copy link

@odyth agree. That's not a bug. NSNull should be converted to nil

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants