Answer the question
In order to leave comments, you need to log in
How to link an object with a control in Xcode 4?
I ask for help with programming in Objective C and XCode.
I create an object, associate it with the class, after that I try to link the Button with this object, but it doesn't work.
He recorded his actions on video. (I apologize for the Demo Mode on the video, I've only been working with Mac OS for a week, I recorded the first thing that came to hand)
Answer the question
In order to leave comments, you need to log in
Make a method in your Mafoo labeled IBAction. And bind it to performClick: on the button.
arturphoenix
The desired result is not clear.
If you want the button to become an instance of your MAfoo class, then this class must be inherited from NSButton and in the Identity Inspector change the button class to your MAfoo.
If you want the button to have a link to your object, then for this the button must have a corresponding property of type MAfoo. You can make it so that the button has it in the way described above: by replacing the button class with your own.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question