• 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
Question about poseAsClass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Question about poseAsClass
      • From: Creed Erickson <email@hidden>
  • Prev by Date: Re: Referencing Files within a App
  • Next by Date: Re: GCC3?
  • Previous by thread: Re: NSDocument's loadDataRepresentation called before the document UI is functional?
  • Next by thread: Re: Question about poseAsClass
  • Index(es):
    • Date
    • Thread