Question about poseAsClass
Question about poseAsClass
- Subject: Question about poseAsClass
- From: Tom Sutcliffe <email@hidden>
- Date: Mon, 11 Aug 2003 22:12:18 +0100
I'm using poseAsClass to work around the fact that in Jaguar
applicationShouldTerminateAfterLastWindowClosed doesn't work if a
window had an open drawer when you closed it. (if you return YES the
app isn't terminated because the app thinks the window the drawer is
drawn into is still visible).
My question is when [MyWindowFix poseAsClass:[NSWindow class] should be
called.
I tried putting it in my applicationWillFinishLaunching method. However
it doesn't work properly and for some reason the app thinks all its
windows are closed (and therefore terminates) when I close the drawer.
Then I moved it into my app delegate's +initialize method. Same problem.
Then I moved it even earlier in the call sequence, into +load. Now
everything works perfectly.
I know poseAsClass says "The poseAsClass: message should be sent before
any messages are sent to aClass and before any instances of aClass are
created." which I'm assuming is the root of my problem. Can I rely on
my app delegate's +load method being called before any NSWindows are
created (or before whatever is done that causes the strange bug)?
If not, where should I put the pose call? I tried putting it in main.m
which also works but I'd be interested in other people's views on this.
Out of interest, does anyone have any idea why this bug is occurring?
The app doesn't crash and the proper appShouldTerminate sequence is
followed. And when my redefinition of [NSWindow close] merely calls
[super close] and nothing else I still get this strange quitting
problem.
Thanks,
Tom
_______________________________________________
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.