1

Since the iOS 5 upgrade, we have had intermittent reports of a missing back button, something that is supplied by the UINavigationController.

This app has been live on the app store > 1 year so it is unlikely this issue is resolved by the advice provided here, here or here.

I have attached a screenshot showing this issue. Unfortunately I have not been able to repro it on the simulator or on my device, but we have had several reports so far from users.

missing back button

Has anyone else encountered and/or successfully resolved this issue in iOS5?

Thanks!

Community
  • 1
  • 1
esilver
  • 27,713
  • 23
  • 122
  • 168
  • how are you creating your UINavigationController? instantiating via a XIB file or programatically via initWithRootViewController? – Michael Dautermann Oct 29 '11 at 01:56
  • I make use of Three20, so the TTNavigator class instantiates a UIViewController which itself contains four UINavigationControllers and a custom-drawn TabBar. XIBs are not in use anywhere in the code. – esilver Oct 29 '11 at 04:35

1 Answers1

4

I believe I have uncovered the cause of this issue in at least one of the cases. When a user in iOS 5 clicked on a notification, this callback would be called:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo

This method would push a view onto the UINavigationController, which actually was new behavior we recently introduced. If the application was previously running it would work properly. If the application was not previously running, it would prematurely push a view onto the navigationcontroller prior to everything being initialized.


Separately from this, there was another issue that caused this bug. I was setting the title of the previous view to the empty string @"", not to be confused with nil, and in this case no back button was being drawn. So, be careful not to ever set the title of your view to the empty string or you will not get a back button!

esilver
  • 27,713
  • 23
  • 122
  • 168
  • In other words, the new view would be pushed as the first view, and thus not have anything to go back to? – Lasse V. Karlsen Oct 29 '11 at 20:30
  • Also, I did a quick google-search for didReceiveRemoteNotification, and reviewed all the links pointing back to Stack Overflow, there seems (to me) to be a few answers here already stating something along the same lines. In particular, this question: http://stackoverflow.com/questions/1998196/how-do-i-tell-if-my-iphone-app-is-running-when-a-push-notification-is-received - seems promising – Lasse V. Karlsen Oct 29 '11 at 20:32
  • Yes -- the new view would be pushed as the first view, and thus did not have anything to go back to. – esilver Nov 01 '11 at 07:36