• 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
Are NSViews autoreleased or released?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Are NSViews autoreleased or released?


  • Subject: Are NSViews autoreleased or released?
  • From: Kaspar Fischer <email@hidden>
  • Date: Mon, 5 Dec 2005 22:30:55 +0100

Hi,

Are NSViews autoreleased or released? For instance, when a
window gets closed, are the window's views and subviews
released or autoreleased?

If they are released, I should probably deregister the view
(from being an observer) and unbind its contents in -[dealloc].
But what if they are autoreleased? Where can I deregister the
view from being an observer (unbind, resp.) then?

I know of at least one case where a view is autoreleased:
when you call [view removeFromSuperView], see

http://www.cocoabuilder.com/archive/message/cocoa/2004/12/20/124289

But from the unobserving/unbinding point of view, it makes
sense to deregister/unbind immediately and not only when
the autorelease pool is deallocated (because in the latter
case they might be unobserved/unbound in any order).

Thanks,
Kaspar
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Are NSViews autoreleased or released?
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: NSToolbar missing notification?
  • Next by Date: Re: NSToolbar missing notification?
  • Previous by thread: How to "break" all bindings for the object?
  • Next by thread: Re: Are NSViews autoreleased or released?
  • Index(es):
    • Date
    • Thread