开发者

Calling Button-Clicked Function From Code

开发者 https://www.devze.com 2023-03-16 13:24 出处:网络
I have a function set up in my code like so: -(IBAction) buttonClicked: (id) sender{ //various expressions开发者_运维技巧 here

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消