Hi Laurent,
Thanks for the hint. Searched and found some docs that say the same thing.
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcFinalize.html
Dave.
On 29 Apr 2010, at 23:08, Laurent Sansonetti wrote:
> Hi Dave,
>
> Normally, you would
Hi Dave,
Normally, you would do this in -finalize, since -dealloc will not be called
under GC.
Now, I believe (this should be confirmed...) that under GC,
NSNotificationCenter & friends automatically unregister observers when they get
collected. This is done through the weak reference machiner
A common design pattern in cocoa seems to be to have a objc method along the
lines:
- (void)dealloc {
// Stop observing the tool palette.
[[NSNotificationCenter defaultCenter] removeObserver:self
name:SKTSelectedToolDidChangeNotification object:[SKTToolPaletteController
sharedToolP