Adding methods to MyDocument?
Adding methods to MyDocument?
- Subject: Adding methods to MyDocument?
- From: <email@hidden>
- Date: Thu, 17 Feb 2005 11:56:19 +0000
Is this possible? Here is what I've done. I have a doc-based test app. I have added a method to MyDocument in XCode, declaring in the header file and then putting a stub in the implementation file. I go into IB and read MyDocument.h in. It recognizes the method (i.e. the NSDocument subclass in the Classes pane of MyDocument.nib shows the action listed under Attributes). I ctrl-drag from the button to File's Owner, it highlights the method and lets me connect. I head back into XCode quick and place a quick NSLog() in the method stub (yes I have correctly set the return type to IBAction and used the parameter (id)sender), just to output something to the screen.
I compile with no errors but when I run and click the button nothing happens. I've even set a breakpoint at the beginning of the method, run the program in the debugger. The debugger does not even stop at all.
So I'm thinking this isn't allowed for some reason. Can you add methods to MyDocument to be responded to when a user clicks a button (or something similar)? The reason I want to do it this way is because MyDocument contains model object info that I'll eventually want to do something with in this button action. Will it make more sense to have some kind of AppController to take care of this action? But then I'll have to get the model object instance from MyDocument somehow, and it would be a lot easier and make more sense if I could just do it all in MyDocument. Thanks.
James
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden