Toran Billups
Toran Billups

Reputation: 27399

How to compare against an empty NSArray showing <null>

I'm doing some validation and can't seem to get what should be a simple conditional right

my method has an arg of NSArray and when I NSLog it out I get the following

"var was <null>"

Yet when I do something like the below It always returns YES / TRUE

if (array != nil) {

}

this also fails

if (array != NULL) {

}

Thank you in advance

Upvotes: 0

Views: 218

Answers (1)

Lily Ballard
Lily Ballard

Reputation: 185671

Sounds like it actually contains [NSNull null]. Plain old nil is logged as (null).

Upvotes: 3

Related Questions