Re: Behavior of autoreleased window controller for closing window vs. app termination
Re: Behavior of autoreleased window controller for closing window vs. app termination
- Subject: Re: Behavior of autoreleased window controller for closing window vs. app termination
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 06 Oct 2002 12:09:16 -0400
on 02-10-06 11:14 AM, Matt Neuburg at email@hidden wrote:
>
> Can anyone give me any ideas of what is going wrong? Why I am seeing 2
>
> calls to windowWillClose which obviously is over-releasing the window.
>
>
It might help to include a test at the beginning of windowWillClose to make
>
sure that the window that generated the notification is the window you're
>
interested in. In my app (MemoryStick) I had a similar problem. I have two
>
possible windows, the main window and prefs window. But on quit I get a
>
windowWillClose notification from a mysterious "third window" whose origin
>
and nature I was never able to determine. I solved my crash-on-quit by
>
ignoring this notification. If you look back through the archives you can
>
find the discussion of this.
Remember that closed windows and panels can be simply moved offscreen by
Cocoa, for performance reasons in case they are reopened later. So any
message to all windows will be received by offscreen windows as well as
onscreen windows. You can use something like isVisible to distinguish
between them, as I recall. This is especially important when trying to count
windows when all you want is the windows that are "open."
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
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.