ObjectiveC – Power of “AT Sign” aka “@”

The at sign @ is also commonly called the at symbol or commercial at in English—and less commonly a wide range of other terms.
he fact that there is no single word in English for the symbol has prompted some writers to use the French arobase or Spanish arroba—or to coin new words such as asperand, ampersat—but none of these have achieved wide currency.

[wikipedia]

Objectivec generally use @ sign to declare

[code lang=”java” autolinks=”false” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”false”]@implementation, @interface, @end, @synthesize, 
@dynamic, @public, @private, @property[/code]

and the string objects: @”MyString”.

Have you used to make an autoreleased array or a dictionary? Or a math expression?

[code lang=”java” autolinks=”false” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”false”]NSLog(@"\n %@ \n %@ \n %@ \n %@",
@"aString",                             // a string
@(5+2),                                 // an object result expr
@[@"A", @"B", @"C"],                    // an NSArray
@{@"Key_1" : @"asd", @"Key_2": @"qwe"}  // an NSDictionary
);[/code]

Very useful!

Alberto Pasca
Latest posts by Alberto Pasca (see all)