user339946
user339946

Reputation: 6119

Wiring NSToolBarItem with XIBs

For some reason I'm having a very difficult time wiring my NSToolbarItem to an IBAction.

I'm using an NSWindowController with its own XIB. The NSToolbar is dropped into the XIB, and I added the NSToolbarItem without issue. This whole NSWindowController is created by a master NSViewController when an image is clicked.

The problem lies with the new button not sending. I unchecked "Autovalidates" and checked "Selectable" so that I could actually click the button.

However when pressed, I receive "unrecognized selector sent to instance".

I've wired this several times over through the XIB interface to make sure I wasn't messing up.

What's going on? Thank you.

Full error:

-[__NSCFType buttonPressed:]: unrecognized selector sent to instance 0x101915010

Upvotes: 0

Views: 201

Answers (1)

Herm
Herm

Reputation: 2999

The delegate class does not know the selector you've wired. Either your delegate is wrong or you've got a typing error in your method.

Check the signature of the Method you've declared in your headerfile vs. its implementation in the class file. Perhaps you forgot to declare a parameter.

edit: the class type where the selector is called looked weird, so I googled __nscftype unrecognized selector. here are some suggestions, it seems like your delegate is already disposed : http://imlocation.wordpress.com/2007/09/13/strange-objects-nscftype-indicate-memory-management-bugs/ [__NSCFType searchKeyword:]: unrecognized selector sent to instance 0x6d8eb80

Upvotes: 1

Related Questions