Call IBAction in other method

Posted by user1628083 on Stack Overflow See other posts from Stack Overflow or by user1628083
Published on 2012-09-13T03:33:33Z Indexed on 2012/09/13 3:38 UTC
Read the original article Hit count: 159

Filed under:

I have an IBAction of SignIn and Method getData. When load it call SignIn into method Getdata in case I want auto sign in without click button Sign In.

-(void)getData
{  
    if ([_remCheckbox state] == NSOnState)
    {
        NSUserDefaults *store = [NSUserDefaults standardUserDefaults];
        
        NSString *un = [store objectForKey:@"usrname"];
        NSString *pw = [store objectForKey:@"usrpwd"];
        
        _txtUsername.stringValue = un;
        _txtPwd.stringValue = pw;
        
        //call event IBAction

        
    }  
}

- (IBAction)buttonSignIn:(id)sender
{
    //Signin code suppose to work fine
}

© Stack Overflow or respective owner

Related posts about ios