• 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: NSWindowController subclass initialization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindowController subclass initialization


  • Subject: Re: NSWindowController subclass initialization
  • From: "Jeff Hellman" <email@hidden>
  • Date: Sat, 2 Dec 2006 18:09:22 -0800

Oops-

I made a few typos when posting this to the list.

I have no class "HandoutsReportController" only HandoutReportController.

The code in question really reads:

      NSLog(@"handout report pressed");
      HandoutReportController *hrc = [[HandoutReportController alloc] init];
      NSLog(@"hrc: %@", hrc);
      NSWindow *hrcWindow= [hrc window];
      NSLog(@"hrc window: %@", hrcWindow);

And the init code for HandoutReportController is:

      NSLog(@"init called for Handout Report Controller");
      self = [super initWithWindowNibName:@"HandoutsReportPanel"];
      return self;

The output in Release mode is:

2006-12-02 17:59:50.764 PlanBook3[17868] handout report pressed
2006-12-02 17:59:50.765 PlanBook3[17868] hrc:
<HandoutReportController: 0xcc50fd0>
2006-12-02 17:59:50.765 PlanBook3[17868] hrc window: (null)

In Debug mode everything works and I get:

2006-12-02 18:00:33.528 PlanBook3[17896] handout report pressed
2006-12-02 18:00:33.543 PlanBook3[17896] init called for Handout
Report Controller
2006-12-02 18:00:33.543 PlanBook3[17896] hrc:
<HandoutReportController: 0xcf4a250>
2006-12-02 18:00:33.545 PlanBook3[17896] hrc window: <NSPanel: 0xcf630b0>

Sorry for the confusion...but I'm still stuck!
Jeff

On 12/2/06, Jeff Hellman <email@hidden> wrote:
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



--
Jeff Hellman
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


  • Follow-Ups:
    • Re: NSWindowController subclass initialization
      • From: Jerry Krinock <email@hidden>
References: 
 >NSWindowController subclass initialization (From: "Jeff Hellman" <email@hidden>)

  • Prev by Date: Re: really elementary to-many inverse relationship question
  • Next by Date: Re: DiskArbitration & Finder
  • Previous by thread: Re: NSWindowController subclass initialization
  • Next by thread: Re: NSWindowController subclass initialization
  • Index(es):
    • Date
    • Thread