Calling Button-Clicked Function From Code
I have a function set up in my code like so:
-(IBAction) buttonClicked: (id) sender{
//various expressions开发者_运维技巧 here
}
The question is, how can I call this buttonClicked() function from somewhere else in the code, without requiring a user click the button. For example, how can I call it from viewDidLoad()?
Thank you for any help.
If you're calling in the same file, you can use:
[self buttonClicked:self];
Depending on what your method does.
精彩评论