Re: Connect a NSTableView to a datasource in another nib
Re: Connect a NSTableView to a datasource in another nib
- Subject: Re: Connect a NSTableView to a datasource in another nib
- From: Quincey Morris <email@hidden>
- Date: Tue, 18 Jan 2011 14:28:40 -0800
On Jan 18, 2011, at 14:10, Luc Van Bogaert wrote:
> I have two seperate nib files (MainMenu.xib and History.xib). I have implemented a controller (HistoryController) to manage the window in History.xib. The history window is displayed using a button in MainMenu.xib that sends an action message to the application delegate. The action method then allocates and initializes a HistoryController object which is then displayed. The window delegate releases the resources upon closing the history window. So far so good.
>
> The history window contains a NSTableView object. I would prefer to implement this table's datasource in the application delegate, so I can keep on collecting data for the table, even when the history window object is nil (not displayed).
Your design was "so far, so good" up to this point.
The data source is part of the window interface. I think you mean to say you want to keep the (or, a) data model in the app delegate, which is fine. Put it there, but implement the data source protocol in the History window controller ...
> I've been struggling (in XBuilder) to connect the NSTableView object in History.xib with it's datasource object (the app delegate) which is in MainMenu.xib.
... so there's no need to connect History.xib to MainMenu.xib.
_______________________________________________
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