• 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
Re: Help with Cocoa document app & controllers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Help with Cocoa document app & controllers
      • From: Rick Mann <email@hidden>
References: 
 >Help with Cocoa document app & controllers (From: Rick Mann <email@hidden>)

  • Prev by Date: Status item using custom view not responding to clicks
  • Next by Date: Custom view not responding to mouse clicks in certain areas
  • Previous by thread: Help with Cocoa document app & controllers
  • Next by thread: Re: Help with Cocoa document app & controllers
  • Index(es):
    • Date
    • Thread