Re: Dynamically loading NIB files into sheets
Re: Dynamically loading NIB files into sheets
- Subject: Re: Dynamically loading NIB files into sheets
- From: Sebastian Celis <email@hidden>
- Date: Tue, 16 Apr 2002 19:39:08 -0500
Thanks for both of your responses! Unfortunately, the problem remains
unsolved...
On Tuesday, April 16, 2002, at 12:51 PM, j o a r wrote:
Can you do something like this somewhere and see what is returned, does
it match what you expected to find?
NSLog(@"SheetController window: %@", [theSheetController window]);
NSLog(@"SheetController window title: %@", [[theSheetController window]
title]);
Yeah, I get a memory address (0x1a85240) for the first one and the title
of my sheet for the second one.
If you implement "windowDidLoad" in your sheet controller (that still
is a subclass of NSWindowController I hope...) is it ever called?
I implemented this, put an NSLog() call inside, , and sure enough, it
was the very first message logged.
Not related to your other problem, but you might consider doing
something like this instead:
aSheetController = [[SheetControllerA alloc] init];
[theSheetControllers setObject:aSheetController forKey:identifier];
[aSheetController release]
return aSheetController;
Yeah, I was aware of this. I just didn't bother putting it in since I
was lazy and didn't even have the sheet working yet. Thanks for
pointing it out, though.
On Tuesday, April 16, 2002, at 12:31 PM, Chris Giordano wrote:
I just put together a quick example of something similar, and can get a
sheet to attach to a document window from either the document nib or
from another nib file loaded through a controller object. One big
difference is that my controller just inherits from NSObject and has an
outlet for the sheet window. As such, my init is a bit different
Hmmm... I was considering the fact that maybe I was initializing my
WindowController incorrectly. I've gotten sheets to work if the
controller inherits from NSObject, but not NSWindowController. Do you
think you might have time to test if you are able to display a sheet on
a document window that is controlled by a class that inherits from
NSWindowController that loads its own nib file (like I am doing)? If
so, I bet we could figure out my problem.
However, I can produce what sound like the results you get (a floating
sheet not attached to any window) by using the passing nil as the
modalForWindow: parameter:
The question is... does that sheet have a title bar? When I passed in
nil, the sheet was displayed with a title bar (but only the title was in
the bar... no close/minimize buttons). When I pass in myDocumentWindow,
the sheet is again floating by itself, but this time it does not have a
title bar at all. It looks just like a sheet... only it is not attached
to anything.
Thanks again. I really hope to get this problem pinned down soon (pun
intended... I'm in need of some levity, right now :-)
Take care,
Sebastian
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.