Re: Help with Cocoa document app & controllers
Re: Help with Cocoa document app & controllers
- Subject: Re: Help with Cocoa document app & controllers
- From: Jeff Johnson <email@hidden>
- Date: Wed, 26 Dec 2007 19:24:04 -0600
Rick,
My guess is that the nib has not yet been loaded when you attempt to
use the IBOutlet. You can determine this for sure by calling -
[NSWindowController isWindowLoaded], and you can load the nib by
calling -[NSWindowController window], for example.
-Jeff
On Dec 26, 2007, at 7:10 PM, Rick Mann wrote:
I'm trying to make a cocoa document app. I have an NSDocument
subclass "ChartDocument", and an NSWindowController subclass
"ChartController". I have a nib file "ChartDocument.nib". It has a
File's Owner, Application, First Responder and Window.
The ChartController has an IBOutlet (IBOutlet ChartView* mChart)
that points to a ChartView in the window. The ChartDocument provides:
- (void)
makeWindowControllers
{
ChartController* chartController = [[ChartController alloc] init];
[self addWindowController: chartController];
/* code to do some stuff that eventually needs the ChartView */
}
In the code represented by the comment above, the ChartController
is called. It, in turn, tries to use the mChart IBOutlet that I
wired up in IB. But it's null.
Can anyone tell me why the mChart ivar isn't getting properly set?
I'm sure I'm overlooking some basic thing.
TIA,
Rick
_______________________________________________
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