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
sharedToolPaletteController]];
// Stop observing the document's canvas size.
[[self document] removeObserver:self forKeyPath:SKTDocumentCanvasSizeKey];
// memory management stuff removed...
}
- taken from the Sketch sample.
One way to handle this would be to add a finalizer method to act in place of
the the dealloc, but is this the best or correct way to handle this?
Thanks,
Dave.
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel