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

// for forward declaration

// similar to function pointers

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

// to assure thread safety

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

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

// type encoding (Apple docs)

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

Happy coding!



Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s