Reputation: 46178
Maybe dumb question:
NSString *var = @"test";
if (var) {
Here var
is casted to BOOL and compared to YES
, isn't it ?
Is there any other value that can be transformed to NO
when casted to BOOL
than nil
and NO
?
Upvotes: 0
Views: 1188
Reputation:
Here
var
is casted toBOOL
and compared toYES
, isn't it ?
No, it isn't, why would it?
Is there any other value that can be transformed to NO when casted to BOOL than nil and NO ?
Any integral expression of value zero does the job.
Upvotes: 2