• 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
One Shot Windows: WARNING
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: iphone and images issues
  • Next by Date: IKImageBrowserView - multiline labels
  • Previous by thread: Re: iphone and images issues
  • Next by thread: Re: One Shot Windows: WARNING
  • Index(es):
    • Date
    • Thread