Compiler directives in 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!

Comments

Popular posts from this blog

Rotate Scale Flip - NSImageView

Why I love programming?

Tint an NSImage view