Question

I followed the Tutorial in Cocoa Programming For Mac OS X to create a preferences window but am returned with 2 warnings which stop it from working/opening. These are the two warrnings: alt text http://snapplr.com/snap/varq

alt text http://snapplr.com/snap/qmxc

How can I resolve the problem?

Was it helpful?

Solution

The warnings mean the object in question doesn't (as far as the compiler knows) implement those two methods. This means either your window controller is not inheriting from the right superclass, or the pointer to the window controller is of the wrong type. It may or may not be the reason your window isn't opening, it's impossible to tell from the warnings alone.

edit: from your full code it looks like you're declaring your controller as inheriting from NSObject, instead of NSWindowController.

OTHER TIPS

Just as it says, showWindow isn't defined on the PreferenceController class. In C++, this would be an error because it's statically typed and would say "method not defined", but since Objective-C is more flexible, this is only a warning. Without seeing the code, it's hard to tell what your mistake is though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top