Looks like the cat is out of the bag, the new Objective-C literals have landed into the clang trunk. This change introduces additional Objective-C Literals.
What is an “Objective-C Literal”? It’s a chunk of code that references a specific Cocoa object, creating it if necessary. Objective-C has had literals for NSStrings since the beginning of time: NSString *greeble = @"Bork Bork Bork";
The syntax is an at-sign, the indication that Objective-C magic is approaching, in front of a C-string literal. This makes an NSString that can be used just like any other NSString. In fact, greeble points to an actual NSString, it’s not any kind of second-class citizen. The new literals for NSNumbers, NSArrays, and NSDictionaries take a similar approach.
Your new post is loading...