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

Cocoa Tip of the Day, 1/14/10

Don't forget NSCell.

The cell abstraction, which is only present in AppKit, not UIKit, makes it easy to reuse simple bits of drawing functionality and dramatically reduces memory usage.  If you are creating a new view, consider using existing NSCell subclasses for some of the drawing and put new drawing functionality into new NSCell subclasses so that you can reuse it elsewhere.

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.