One Shot Windows: WARNING
One Shot Windows: WARNING
- Subject: One Shot Windows: WARNING
- From: Seth Willits <email@hidden>
- Date: Sat, 7 Feb 2009 17:32:58 -0800
I spent two hours trying to figure this out! New window instances in
nib files created with Xcode or IB3 have setOneShot:NO in them. The
default Document Based Cocoa application project, however, sets
oneShot to *YES* in the nib it includes.
This means that if you create a new project, vs create a new nib in an
existing project, the exact same steps and code can produce a crash in
the latter but not in the former.
BAD! BAD! BAD! BAD!
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.
--
Seth Willits
_______________________________________________
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