Reputation: 492
I've seen @(NO)
in objective-c code, I guess it's a kind of syntactic sugar, but what does it actually mean?
Upvotes: 7
Views: 3788
Reputation: 3444
@(expression)
Dynamically evaluates the boxed expression and returns the appropriate object literal based on its value (i.e. NSString for const char*, NSNumber for int, etc.). This is also the designated way to use number literals with enum values.
Upvotes: 11