Question

i am developing a application which have a activity indicator in UINavigationbar and the problem is that when i hide the activity indicator the default navigation back button not displayed in ios 7 but in ios 6 it works perfectly

i am getting self.navigationItem.backBarButtonItem as nil when i print it in console

after hiding activity indicator i have written below code

[self.navigationItem setLeftBarButtonItem:self.navigationItem.backBarButtonItem];

Thanks in advance

Was it helpful?

Solution

Instead of:

[self.navigationItem setLeftBarButtonItem:self.navigationItem.backBarButtonItem];

Try using:

[self.navigationItem setBackBarButtonItem:self.navigationItem.backBarButtonItem];

(I'm not sure if this is going to work exactly like this. It's possible that you'll have to store the back button in a variable prior to showing the activity indicator and than set the back button to that variable afterwards.)

OTHER TIPS

I'm a rank beginner, but my understanding is that the back button displayed is actually a property of the the previous view controller, not of the view controller which is displayed.

Unless you've manually set a back button for the currently visible view controller, it should be nil.

Try logging the back button item from of the previous view controller in the stack, that might help

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top