Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call an id sender function from another function?

Tags:

ios

iphone

In the following code example, I want to be able to call backgroundTap from another function btnSubmitLoginPassword. What parameter should I pass?

-(IBAction) backgroundTap:(id)sender{

    [userName resignFirstResponder];
    [password resignFirstResponder];

}

-(IBAction) btnSubmitLoginPassword{

    [self backGroundTap:?????????]


    [self validate];


}
like image 941
jini Avatar asked Jun 16 '11 05:06

jini


1 Answers

PengOne's answer is good, but the precise answer to your question is: pass nil for the sender parameter:

[self backgroundTap:nil];
like image 66
Seamus Campbell Avatar answered Nov 14 '22 20:11

Seamus Campbell