• 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
Re: Can I somehow encourage the deallocation of a dismissed view controller?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I somehow encourage the deallocation of a dismissed view controller?


  • Subject: Re: Can I somehow encourage the deallocation of a dismissed view controller?
  • From: Conrad Shultz <email@hidden>
  • Date: Wed, 08 Feb 2012 17:12:52 -0800

On 2/8/12 4:54 PM, G S wrote:
> Thanks for the response.
>
>
>     Even *if* deallocation occurs later, that shouldn't cause a crash.
>
>
> I'm not suggesting that this is what's causing the crash.  It's simply
> preventing me from debugging the problem, because I can't reproduce it
> on demand.
>
> It's just a crash in the control's dealloc method:
> 0x0019f56e -[ThumbStripView dealloc]

But what is the crash?  EXC_BAD_ACCESS?

If so, I wonder whether this is just a symptom of an elusive
over-release elsewhere in your code.  Does anything show up in Clang?
Have you tried running with zombies enabled?

> As it turns out, presenting the view modally and then dismissing it
> *does* result in its prompt deallocation.  But the member control's
> dealloc method is not called during the deallocation of the view.  The
> view is loaded from a XIB.  Shouldn't the controls' dealloc methods be
> called then too?

I would expect so.  UINib caches the nib itself in memory, but the
instances should go through a normal life cycle.

(As always, make sure you heed the platform-specific guidance on
IBOutlet memory management:
https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html)

It sounds like you still have something maintaining a strong reference
to your control.  (You remark that -dealloc is not called during
deallocation of the view, which I take to mean you have verified that
the control's superview is *actually* being deallocated.  If you haven't
verified that the superview is getting deallocated, you might be tilting
at windmills by focusing on the control.)

--
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
_______________________________________________

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


References: 
 >Can I somehow encourage the deallocation of a dismissed view controller? (From: G S <email@hidden>)
 >Re: Can I somehow encourage the deallocation of a dismissed view controller? (From: Conrad Shultz <email@hidden>)
 >Re: Can I somehow encourage the deallocation of a dismissed view controller? (From: G S <email@hidden>)

  • Prev by Date: Cocoaheads meeting tonight in Lake Forest CA
  • Next by Date: Re: How to get bookmarks data for non-existing files
  • Previous by thread: Re: Can I somehow encourage the deallocation of a dismissed view controller?
  • Next by thread: Can I somehow encourage the deallocation of a dismissed view controller?
  • Index(es):
    • Date
    • Thread