Hey all, I'm back again with a few cocoa questions I've yet to find the answers to on Google. To the experienced programmer these should be a piece of cake.
1) In a Document-based app, how do you connect menu items to the methods? I have an IPController class, instantiated in both MyDocument.nib and MainMenu.nib. I want to connect a menu item to the class so it can show a help panel existing in MyDocument.nib. Is this possible, or do I have to have an duplicate instance to the same panel in both NIBs?
(The "Help..." menu should open it from MainMenu, and there's a button on a MyDocument window that opens it too.)
2) Toolbar items. Lets say I have a method in IPController.m that opens a sheet. There's an NSButton on the window itself whose action is connected to the method in said IPController class. Now, for the toolbar to work, all the code for it is in MyDocument.m. Problem is connecting the action of the toolbar item to the method in IPController. Any ideas?
Right now I have the action set to "-(void)blahHelper()" which tells an instance of IPController to performSelector(). This doesn't work though. The original method in IPController opens a new sheet, but when I call the method through the toolbar item, I get a "Model session requires modal window" problem.
Thanks for the read and the help, I hope I made this easy enough to understand.
1) In a Document-based app, how do you connect menu items to the methods? I have an IPController class, instantiated in both MyDocument.nib and MainMenu.nib. I want to connect a menu item to the class so it can show a help panel existing in MyDocument.nib. Is this possible, or do I have to have an duplicate instance to the same panel in both NIBs?
(The "Help..." menu should open it from MainMenu, and there's a button on a MyDocument window that opens it too.)
2) Toolbar items. Lets say I have a method in IPController.m that opens a sheet. There's an NSButton on the window itself whose action is connected to the method in said IPController class. Now, for the toolbar to work, all the code for it is in MyDocument.m. Problem is connecting the action of the toolbar item to the method in IPController. Any ideas?
Right now I have the action set to "-(void)blahHelper()" which tells an instance of IPController to performSelector(). This doesn't work though. The original method in IPController opens a new sheet, but when I call the method through the toolbar item, I get a "Model session requires modal window" problem.
Thanks for the read and the help, I hope I made this easy enough to understand.