Re: Core Data Question 1
Re: Core Data Question 1
- Subject: Re: Core Data Question 1
- From: Quincey Morris <email@hidden>
- Date: Tue, 19 Aug 2008 22:32:49 -0700
On Aug 19, 2008, at 21:39, R T wrote:
I have a Core Data Document-based Application.....a document window
with a tableview, a text view and a button. When the button is
selected, a number is read from the text field and that many
objects are programatically added to the tableview. Then a sheet is
opened. The tableview presents only part of the attributes of an
entity. The sheet will present the remaining attributes in it's own
tableview.
My problem is that I need the sheetController to have access to the
myDocument.h instance variable, NSArrayController *tableController,
which is bound to the managedObjectContext. I'm having trouble with
this. Is the instance variable of the document available to the sheet?
The easiest way is probably to subclass NSWindowController, putting
the sheet window in its own NIB file and setting the class of File's
Owner to your window controller subclass. Your window controller can
be initialized with any properties you need (such as the document),
which means you can bind various interface items in the NIB file
through File's Owner.document (or whatever).
I wouldn't recommend referring to objects in the underlying window's
interface in your sheet. (So, don't refer to document.tableController
from the sheet.) Instead, make properties of your document object that
contain the data that the sheet needs.
HTH
_______________________________________________
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