What are the details of "Objective-C Literals" mentioned in the Xcode 4.4 release notes?

Pedro Mancheno picture Pedro Mancheno · Feb 19, 2012 · Viewed 61.2k times · Source

I was going through the release notes for Xcode 4.4 and noticed this:

LLVM 4.0 Compiler

Xcode now includes the Apple LLVM Compiler version 4.0, including the following newObjective-C language features: [...]
- Objective-C literals: create literals for NSArray, NSDictionary, and NSNumber, just the same as the literals for NSString

I'm intrigued about this feature. It's not entirely clear to me just how literals for NSString work and how one could use them on NSArray, NSDictionary, and NSNumber.

What are the details?

Answer

Pooria Azimi picture Pooria Azimi · Feb 19, 2012

Copied verbatim from http://cocoaheads.tumblr.com/post/17757846453/objective-c-literals-for-nsdictionary-nsarray-and:

Objective-C literals: one can now create literals for NSArray, NSDictionary, and NSNumber (just like one can create literals for NSString)