Objective-C Literals, Part 1
March 16, 2012
Nice write-up from Mark Dalrymple on a new, very long overdue feature in Objective-C: literal syntax for creating numbers, arrays, and dictionaries. In current Objective-C, to create a NSNumber
object you have to write (for example) [NSNumber numberWithInt:7]
. Now, you'll be able to create the same object with the much shorter @7
. The new syntax is already supported for building Mountain Lion apps; can't wait until it works on iOS. (via Brent Simmons)