• 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
Best data source for table view in document window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best data source for table view in document window


  • Subject: Best data source for table view in document window
  • From: Jerry Krinock <email@hidden>
  • Date: Wed, 05 Sep 2012 05:39:47 -0700

What is the best the data source for a table view in a document window?  The candidates are…

(1)  Category of the document.  This is the way it is done in the WithoutBindings ("With and Without Bindings") Apple sample code.  But it seems like too much "view-ish" code in the data model, particularly when my document class is also used in a GUI-less command-line tool, which has no need for this code.

(2)  Separate, standalone object.  Fancy housekeeping is needed to avoid retain cycles, and crashes in corner cases as the document window is closing.

(3)  Category of the window controller.  Probably not a bad choice, except that my window controller for this multi-tabbed window is already huge.

(4)  Category of the table view itself, assuming that it is subclassed.  Seems like a logical division.  No worrying about whether table view or its data source gets deallocced first.  Access the document via [[[self window] windowController] document].

* * *

I've used (2) but think I'm going to switch to (4).  Any important considerations I've overlooked?

Thanks,

Jerry


_______________________________________________

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


  • Follow-Ups:
    • Re: Best data source for table view in document window
      • From: Chris Hanson <email@hidden>
    • Re: Best data source for table view in document window
      • From: Seth Willits <email@hidden>
    • Re: Best data source for table view in document window
      • From: Kyle Sluder <email@hidden>
    • Re: Best data source for table view in document window
      • From: Alex Zavatone <email@hidden>
  • Prev by Date: Re: Sandboxing redux
  • Next by Date: Re: Best data source for table view in document window
  • Previous by thread: Re: Sandboxing redux
  • Next by thread: Re: Best data source for table view in document window
  • Index(es):
    • Date
    • Thread