Compiler directives @ objective-C 2.0

Here are the list of directives in Objective-C 2.0. Let me know if anything is missing.

// directives used in class declaration
@interface @public @package @protected @private @property @end

// directives used in class implementation
@implementation @synthesize @dynamic @end

// creating a string object
@”string”

// for forward declaration
@class

// similar to function pointers
@selector()

// used for method declaration mainly for delegation purpose
@protocol @required @optional @end

// to assure thread safety
@synchronized

// handling memory issues (useful in ARC enabled apps)
@autoreleasepool

// throwing and handling exceptions
@throw @try @catch @finally

// type encoding (Apple docs)
@encode

// aliasing an existing class name to a new one (useful in refactoring)
@compatibility_alias

Happy coding!

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s