I am writing a document-based application, and seem to be having a problem with my NSDocument object (using the standard MyDocument.h/m) changing. In particular, I have a toolbar button that brings up a previously populated NSWindowController and shows a window and a panel). The problem appears in three stages:

(1) When MyDocument is initialised, NSLog(@"%@",self); returns x.
(2) When the toolbar button is clicked, the appropriate panel comes up, and NSLog(@"%@",self); returns x. (3) When the toolbar button is clicked a second time, NSLog(@"%@",self); returns y (where x is not the same address as y).

Now as far as I can tell, there is no alloc/init (this only happens in the designated initialiser) or copy of MyDocument (there is an assign of MyDocument to the NSWindowController object so I can call back to methods in MyDocument.m). Note that if I click on the toolbar button a third time, NSLog(@"%@",self); returns y. I can't seem to figure out how the new MyDocument object is being created. Any help would be appreciated.
_______________________________________________

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 arch...@mail-archive.com

Reply via email to