Home > Blogs > Cocoa Tip of the Day, 1/11/10

Cocoa Tip of the Day, 1/11/10

Separate interfaces and implementations.

Objective-C encourages you to put class interface and implementation declarations in different places.  If you are using the non-fragile ABI, then you can also remove all of the non-public instance variable declarations from your headers and provide a different @interface in your implementation file that actually defines them.  Only put things in the header files that other people will need to be able to use your code; don't expose the implementation details.

Cocoa Programming Developer's HandbookFor more tips, and more detail about this tip, please see my new book,
Cocoa Programming Developer's Handbook,
available in print and electronic formats.

Become an InformIT Member

Take advantage of special member promotions, everyday discounts, quick access to saved content, and more! Join Today.