Re: When should one call unbind:? (in a GC application)
Re: When should one call unbind:? (in a GC application)
- Subject: Re: When should one call unbind:? (in a GC application)
- From: mmalc crawford <email@hidden>
- Date: Thu, 1 Nov 2007 10:26:32 -0700
On Nov 1, 2007, at 3:34 AM, Alastair Houghton wrote:
Now I don't know where to call -unbind. Doing it in -finalize seems
dangerous, what with Apple discouraging it so much.
This is <rdar://5497135> BTW.
Ideally, if you're using GC, you shouldn't need to do this sort of
thing because whatever is implementing the binding should be using a
nilling weak reference, and can therefore detect when you go away
and clean up itself.
No, that doesn't happen unfortunately.
On Oct 31, 2007, at 12:03 PM, Sean McBride wrote:
The new Apple recommendation became:
[...] as documented here:
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html#unbinding
>
I should point out that my hints page does not constitute "official
documentation".
That said, the recommendation is still to use -
(void)viewWillMoveToSuperview:(NSView*)newSuperview if your view isn't
going to go to full screen mode. If it is, you may still have to use
dealloc/finalize...
mmalc
_______________________________________________
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