Possible duplicate:The purpose of the @ character before the lines?
I was curious what it means @before each line is objective C. Is it easier on the compiler or more efficient?
@
Example:
NSString* flavour = @"Chocolate"
@"Chocolate"- this is just a shortcut to create an instance NSString. You can also use:
@"Chocolate"
NSString
[[NSString alloc] initWithUTF8String:"Chocolate"];
If you did not use @, you would create a string C (array char).
char
@ C ++, Objective-C , . "Objective" C ++.
Since Objective-C is a superset of simple C, there should be a way to distinguish NSStringliterals from simple C lines (which are basically just pointers char*).
char*
Differences between c lines and objective-c class I think