tags:

views:

211

answers:

2

There is a text field to enter PIN in my login form. When i press "login" button i call the following method:

* (IBAction) loginBeforeAction:(id) sender { 
      [pin resignFirstResponder]; 
      [progressView performSelectorInBackground:@selector(startAnimating) withObject:nil]; 
      [self login]; 
}

but i the number pad is not hiding before the control moves to login method. In effect, i am can see the progress view with the number pad up. Is there any way to hide the number pad first and then show progress view ? plz help

A: 

Yes, The UI won't update until you get through the runloop. Meaning, your UI doesn't update until your login method finishes. Also, no need to update your progressView in the background either.

So, just delay the calls:

[progressView performSelector:@selector(startAnimating) withObject:nil afterDelay:0.1];
[self performSelector:@selector(login) withObject:nil afterDelay:0.25];
Corey Floyd
A: 

Yes. It worked...thanks

Sreehari