Reputation: 2413
If I have this function for button click
-(IBAction)loginButton:(UIButton *)sender{ }
How can I call this button function from this another method
-(void)increaseAmount {
myNumber = myNumber+0.01;
if (myNumber >= 1) {
[self loginButton:sender];
}
progressViewAuto.progress = myNumber;}
I have tried the above code but getting error that USE OF UNDECLARED IDENTIFIER 'sender'
Upvotes: 1
Views: 4821
Reputation: 47759
And, if you want to be perfectly correct, you can link your UIButton to IBOutlet UIButton* theLoginButton;
and then say [self loginButton:theLoginButton];
.
But this would only be needed if you actually reference the sender in your loginButton routine, and that's the exception rather than the rule.
Upvotes: 1
Reputation: 34912
You probably just want to send nil
, like this:
[self loginButton:nil];
Upvotes: 0