• 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: same table, different delegates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: same table, different delegates


  • Subject: Re: same table, different delegates
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Thu, 25 Dec 2003 12:24:54 -0800

Hello...

The "standard" Cocoa approach would be to create a seperate class that handles the delegate responsibilities instead of adding the code to an NSWindow subclass or an NSTableView subclass.

Then each window would have a seperate instance of NSTableView, with either it's own or a shared instance of your class that handles the delegate responsiblities. If you have a custom class that you are using as your datasource, you could also add the delegate methods to that class, and use a seperate instance for each tableView in your application.

Hope that helps,

Louis

PS: Merry Christmas (and happy holidays) to all on the list! ! !


Hi,

I have a window with a table to display some data. The window is the delegate so I set up all the code for populating, sorting the table in the window code. Now I am adding a feature to the app that uses different window, but the same table, using different data. So the populating, sorting code is all the same. I can of course just copy all the delegate code from one window to the other, but it seems to me that I can do this easier, maybe by creating a MyTableView class. In that case, I guess I need to put all the code in the table class, not in each window. Is this a good approach, in other words, can I use a table by itself, without the delegate?


thanks,

- Koen.
_______________________________________________
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: 
 >same table, different delegates (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: same table, different delegates
  • Next by Date: Re: Table Data and NSArrayController
  • Previous by thread: Re: same table, different delegates
  • Next by thread: upside down image
  • Index(es):
    • Date
    • Thread