• 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: Question about Deprecated Methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about Deprecated Methods


  • Subject: Re: Question about Deprecated Methods
  • From: Charles Srstka <email@hidden>
  • Date: Sat, 27 Mar 2004 17:50:05 -0600

On Mar 27, 2004, at 5:42 PM, Chris Hanson wrote:

On Mar 27, 2004, at 6:31 PM, Charles Srstka wrote:
On Mar 27, 2004, at 4:48 PM, Chris Hanson wrote:
When writing for a world before bindings I generally use a TableDataSource class that can (for example) return an NSArray of the selected objects in the table.

D'oh - of course. That's the perfect way to do it. Now why wasn't I doing that already...

What's more, you can make your TableDataSource have a dataSource outlet and a keyPath attribute. It can use KVC to look inside that keyPath in its dataSource to find an array of objects to display, using the identifier of the displayed NSTableColumns to determine the actual attributes to display. You can even make it handle things like sorting independently of the table's contents.

Then if you wrap it in a simple palette that lets you specify the keyPath in IB, you have a cheap knockoff of NSArrayController. I wrote one of those for myself right before WWDC last year. Talk about timing, eh?

Well, I already have the TableDataSource object (obviously, otherwise the table view wouldn't work without a data source) but the problem with making a custom NSArrayController is that the table view happens to be an outline view, and the hierarchy is a bit more complex than a simple array. I suspect this is also why there's no Controller class for outline views. Sounds like a good idea for ordinary tables, though.

Charles
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Question about Deprecated Methods (From: Seth Willits <email@hidden>)
 >Re: Question about Deprecated Methods (From: Charles Srstka <email@hidden>)
 >Re: Question about Deprecated Methods (From: Chris Hanson <email@hidden>)
 >Re: Question about Deprecated Methods (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: Memory management question
  • Next by Date: Re: Memory management question
  • Previous by thread: Re: Question about Deprecated Methods
  • Next by thread: Re: Question about Deprecated Methods
  • Index(es):
    • Date
    • Thread