I am absolutely clueless on this front! Step-by-step explanation earns bonus points.
I am absolutely clueless on this front! Step-by-step explanation earns bonus points.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In iOS We have UIButtons (not NSButtons)
Here is how to create an UIButton programmatically:
and :
1: if you are in a
UIViewController, thenaViewwill beself.viewif you are somewhere else, just pass the view that will contain your button
2: the easiest case is like that but you can set any object as a target. That object must have to have the method you pass in the
@selector(...). Otherwise you app will crash when pressing the button.