Reputation: 4189
I have a stupid problem with Xcode. Sometimes - and I don't know why, because I always follow the same procedure - if I create an IBAction from the nib file of my NSViewController to the .h-file of this NSViewController, I get the error "Could not connect the action buttonCancelClicked: to target of class NSViewController".
It's crazy, because the File's Owner is set to the .h-file and even if I click the button, the IBAction is called. Only Xcode throws this error.
Is this a bug of Xcode? Can I do something to remove this error?
Upvotes: 1
Views: 776
Reputation: 7778
Another reason that will generate this message is when the class identifier is not pointing to the correct Project. I had copied a class from one project to another.
My initial class identifier looked as follows:
This generated the console messages as shown in the original question.
I set the class then as follows:
This solved the problem.
Upvotes: 0
Reputation: 314
An NSViewController serves to manage NSViews. Disconnect the button first. Declare the action in (maybe another) class, save, and read the header in IB again and connect it in IB the button. That's how I do it and never had a problem.
Upvotes: 1