NSWindowController subclass initialization
NSWindowController subclass initialization
- Subject: NSWindowController subclass initialization
- From: "Jeff Hellman" <email@hidden>
- Date: Sat, 2 Dec 2006 15:03:11 -0800
Hi All-
I have a multiple document application where I'm using sheets as a way
to display reports related to the current document. Here's my
problem:
I have a class HandoutsReportController that is an NSWindowController
subclass. I am using a menu item to create the
HandoutsReportController. Here's some code from MyDocument.m that is
called when the menu item is invoked:
NSLog(@"handouts report pressed");
HandoutsReportController *hrc = [[HandoutReportController alloc] init];
NSLog(@"hrc: %@", hrc);
NSWindow *hrcWindow= [hrc window];
NSLog(@"hrc window: %@", hrcWindow);:
In HandoutsReportController.m I have the following method:
-(id) init {
NSLog(@"init called for Handouts Report Controller");
self = [super initWithWindowNibName:@"HandoutsReportPanel"];
return self;
}
This doesn't work. The output from the program (in Active Build
Configuration: Release) is:
2006-12-02 14:51:04.831 PlanBook3[17602] handouts report pressed
2006-12-02 14:51:04.831 PlanBook3[17602] hrc:
<HandoutReportController: 0xcc6a650>
2006-12-02 14:51:04.831 PlanBook3[17602] hrc window: (null)
Notice that the init method in HandoutsReportController is never
called. If I change my Active Build from Release to Debug, this works
perfectly:
2006-12-02 15:00:02.806 PlanBook3[17621] handouts report pressed
2006-12-02 15:00:02.807 PlanBook3[17621] init called for Lesson Plan
Report Controller
2006-12-02 15:00:02.807 PlanBook3[17621] hrc:
<HandoutReportController: 0xcf08570>
2006-12-02 15:00:02.809 PlanBook3[17621] hrc window: <NSPanel: 0xcf62d70>
Thus, I know the NIB exists and that Any thoughts on what's going on?
I've used this exact same process for several other reports that work
perfectly in the same app and am extremely confused about what's going
on. I've checked that the files for HandoutReportController are
target members of my application.
Thanks for any help
Jeff Hellman
--
Jeff Hellman
http://planbook.sciteacher.com
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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