Hi All.
I have an AppController class that looks after view/control in my app in the usual way.
There's a button on my app's main window in IB that causes AppController to instantiate a new window controller (accountPanelController) and show that secondary window:
- (IBAction) showAccountPanel:(id) sender
{
//Is accountController nil?
if (!accountPanelController) {
accountPanelController = [[AccountPanelController alloc] init];
}
[accountPanelController showWindow:self];
}
When that new window is done with, I want to send the data collected from my secondary window controller to a method in AppController:
- (IBAction) close: (id) sender
{
NSLog(@"Close detected");
[AppController addAccount:0];
[self close];
}
However, when I try and call the addAccount method in AppController from the new window controller, I get an "'AppController' may not respond to '+addAccount'" warning.
This seems to be related to AppController being a class rather than an object instantiation, since the method in AppController is called -addAccount (rather than the +addAccount reported in the warning). Indeed, if I change the name of the target method to +addAccount instead of -addAccount, the warning does not appear (but the program crashes on execution).
Given that I don't actually instantiate AppController myself (I guess that happens somehow during NIB initiation), does anyone have any ideas how I can send the data to the AppController method? Notifications seem like overkill...
Many thanks.