It is new way to use literals in Xcode 4.4
No other benefit I guess but its new style of coding
Few references are as, I hope this will clear few of your doubts.
int a = 2;
int b = 5;
NSNumber *n = @(a*b);
@blah
is called the "literal" syntax. You use it to make objects wrapping a literal, like a char, BOOL, int, etc. that means:
@42
is a boxed int
@'c'
is a boxed char
@"foo"
is a boxed char*
@42ull
is a boxed unsigned long long
@YES
is a boxed BOOL
All of the things following the at sign are primitive values. MyEnumValue
is not a literal. It's a symbol. To accommodate this, generic boxing syntax was introduced:
@(MyEnumValue)
You can put a bunch of things inside the parentheses; for the most part, any sort of variable or expression ought to work.