On 20/05/2009, at 1:43 PM, Erg Consultant wrote:

I have my own objects I store in an NSOutlineView. Each object has a name property.

When I implement my custom NSFormatter to tell the table how to draw cells,

This is not what NSFormatter does. How a cell is drawn is defined by the cell. The content of the cell may be modified by a formatter, but the formatter isn't required and doesn't draw anything.


do I create a separate subclass of NSFormatter, or can I make my existing data class subclass from NSFormatter and then use the data objects for both data and as the NSFormatter? It seems silly to have to create separate objects just to do the formatting when I am already storing the data objects in the table to begin with.


You can do whatever you like. A formatter isn't compulsory. Your data objects can supply their data in whatever form makes sense. It's the cell that draws it.

--Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to