Reputation: 3
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.
Upvotes: 0
Views: 124
Reputation: 665
If you're calling in the same file, you can use:
[self buttonClicked:self];
Depending on what your method does.
Upvotes: 2