I got error messages "cannot connect to target of class"

I have a document-based application. In the document window I have connected buttons to actions in the window controller, but when starting the application the AppKit seems to try to connect my buttons to my document class instead of my window controller class, what's wrong ?
makeWindowControllers of your document class.
If you stay with
windowNibName the target for widgets in the window will be set to the document object…
So the solution is:
- remove
windowNibName method from your document class
- replace it with
- (void)makeWindowControllers in which you will allocate your window controller object and don't forget to call [self addWindowController:myController];
- you will probably also need to add a
- (id)init to you window controller class:
- (id)init
{
return [self initWithWindowNibName:@"
myWindowNibName"];
}
When developing a document-based application for which the document window will have a window controller class, you have to overwite