• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Clarification on custom NSFormatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clarification on custom NSFormatter


  • Subject: Re: Clarification on custom NSFormatter
  • From: Graham Cox <email@hidden>
  • Date: Wed, 20 May 2009 13:52:31 +1000


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@hidden)

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:
This email sent to email@hidden


References: 
 >Clarification on custom NSFormatter (From: Erg Consultant <email@hidden>)

  • Prev by Date: Debugging ineffective binding?
  • Next by Date: Re: Synthesized properties for scalars not KVO compliant
  • Previous by thread: Clarification on custom NSFormatter
  • Next by thread: Debugging ineffective binding?
  • Index(es):
    • Date
    • Thread