Re: One Shot Windows: WARNING
Re: One Shot Windows: WARNING
- Subject: Re: One Shot Windows: WARNING
- From: Matt Neuburg <email@hidden>
- Date: Mon, 09 Feb 2009 22:02:33 -0800
- Thread-topic: One Shot Windows: WARNING
On Sat, 7 Feb 2009 21:06:20 -0800, Seth Willits <email@hidden> said:
>On Feb 7, 2009, at 8:45 PM, Matt Neuburg wrote:
>
>>> In my case, I have a document window with a table view in it, where
>>> data source and delegate are the window controller. If the window is
>>> oneShot NO, then the window controller is deallocated, but the views
>>> in the window are still alive, and it tries to draw those views,
>>> sending table view data source methods to the deallocated window
>>> controller.
>>> KABOOM.
>>
>> Are you sure you're barking up the right tree?
>
>Absolutely. 100% reproducible in a bare bones app. I should have
>posted this in the first message:
>
>http://www.sethwillits.com/temp/OneShotDocTest.zip
>
>As is, launch the app, close the window using Cmd-W and it will crash.
>(Clicking on the close widget works fine.)
>Go into the nib and change One Shot to YES and it will not not crash.
Actually, having looked at your example, I reproduced the crash from the
bottom up by starting with the Document Architecture template.
I created a window controller class, made it the Document nib's owner,
overrode makeWindowControllers, put a table view in the window, made the
nib's owner the table view's data source, and put code in the window
controller to populate the table. Sure enough, it worked fine, but when I
unchecked One Shot, it crashed if I closed the window with command-W.
The crash doesn't happen if there is just an NSDocument; it has something to
do with the intermediate NSWindowController. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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