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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to