Navigation controller popViewControllerAnimated : yes is not working as expected

user3441955 picture user3441955 · Mar 20, 2014 · Viewed 28.8k times · Source

I am using following line of code:

[self.navigationController popViewControllerAnimated:YES];

But it is not behaving in ios 7 as it doing in ios 6.Some times it does not pop controller while we are pressing back button 2- 3 times in succession.
Resulting in abrupt behaviour in navigation bar and deallocating a controller but showing the same on ui .
So when we press anything on that controller it results to a crash since controller is already deallocated.

Answer

cynistersix picture cynistersix · Dec 10, 2014

Check if you're running the code on the UI thread