0

I'm at the beginning of an App wich have a UINavigationController with several consecutive views. Forward navigation is Ok, but I found the next problem in backward navigation:

When I touch in back button in one of the views which have to do some work, the app shows a 'Loding...' label, because it take 5-10 seconds to get back. But, if one person touches two times de back button (thinking that the first touch haven't work), once the app has done the 5-10 seconds work, the app goes back two views in navigationcontrolles: one for the first view and then for the second touch in the back button of the previos view.

Root View -------> View 1 ('Back button 1') -------> View 2 ('Back button 2')/n

|                 |                                   |      |
|                  -----------------------------------       |
|                    One touch and 5-10 seconds work         |
|                                                            |
 ------------------------------------------------------------
Two consecutive touches on the same place (user haven't wait)

How can I avoid that second touch effect?

Thank you.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Randomclik
  • 29
  • 3
  • Why dont you disable the button on first click? That should do the trick. self.navigationItem.backBarButtonItem.enabled = NO; – Puneet Sharma Jul 11 '13 at 09:13
  • Because the button must be enabled, I've tried something similar that works: first disable the button on push new view; create a method which enable again the button; third call this method on didViewAppear but with a delay of 0.1 seconds: [self performSelector:@selector(enableBackButton) withObject:nil afterDelay:0.1]; . Thanks a lot Punnet, your answer was very helpful. – Randomclik Jul 11 '13 at 10:41

0 Answers0