Question

I have a button class named BFToggleButton, derived from UIButton. In my xib file, I dragged a UIButton, changed its custom class as BFToggleButton. In the Objects part of the IB, I'm seeing this button as Toggle Button - Button.

However, in the code, when I call a method that's not present in UIButton, but present in BFToggleButton class, I get an exception saying that an unrecognized selector is sent to an instance of UIButton.

So that gives me the impression that there may be a problem about setting the custom class in Xcode 4.5. Because if I'm not missing anything this should work according to my experiences with the previous XCodes.

Have you experienced the same thing?

Was it helpful?

Solution

Seems like the problem was about the Target Membership of the BFToggleButton class. I right clicked on this class and selected Show File Inspector and saw that the Target Membership checkbox was not checked and that was why the interface builder didn't recognize this class.

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