Friday, November 30, 2012

An Objective-C Literal Subtlety

Adam Preble:

I would argue that this method should use -boolValue to check the options dictionary values, but I would also argue that this is something the compiler should be handling when it translates the literal syntax into an object. I’ve filed radars on both of these issues this with Apple (rdar://12761147 and rdar://12761621).

He found that GLKit checks the identity of NSNumber objects rather than their value and that @(YES) doesn’t have class __NSCFBoolean.

Comments RSS · Twitter

Leave a Comment