Hi Guys,

I have a document-based non-GC app in which I register my document instance to receive an NSViewBoundsDidChangeNotification for my [[mainTextView enclosingScrollView] contentView].

On dealloc, the document calls [[NSNotificationCenter defaultCenter] removeObserver:self], but these notifications still get sent to the dealloc'd instance when the window itself closes. I think this is something to do with the notification being sent/received in a delayed manner, am I right?

I've now overridden NSDocument's -close method to remove self from observing these notifications before calling [super close] (which works fine) but I was wondering if there was a better, more conventional place to put these -removeObserver: calls. I'm not sure if this makes sense but are there any view-related methods that get called when a document/window closes that would be the best place to de-register for observations of view notifications? Could what I've done bite me if, for example, for some reason -close does not get called?

Thanks,

Jon
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to