Re: Best data source for table view in document window
Re: Best data source for table view in document window
- Subject: Re: Best data source for table view in document window
- From: Alex Zavatone <email@hidden>
- Date: Wed, 05 Sep 2012 08:45:13 -0400
I use a standalone singleton object in Matt Galloway style. Never ran into the crash you're mentioning.
On Sep 5, 2012, at 8:39 AM, Jerry Krinock wrote:
> 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
_______________________________________________
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