dreadbot
dreadbot

Reputation: 962

Navigation Controller - app crashes after 20 views pushed

I have an iPad app that has linear navigation with a Navigation Controller. I am pushing View Controllers one at a time with gestures. I also have a PopOverController menu that can push View Controllers. Trouble is, when I push more than 20 it crashes.

Do I have to manually remove View Controllers from the stack after I get above a certain number? I was under the impression that the Navigation Controller would remove hidden View Controllers automatically.

Many thanks in advance.

Upvotes: 0

Views: 371

Answers (2)

Parth Bhatt
Parth Bhatt

Reputation: 19469

Try releasing all the controllers after you push them onto the stack and also try releasing the navigation controller. Hope this helps

Upvotes: 0

Ricardo de Cillo
Ricardo de Cillo

Reputation: 1164

If you're allocating too much memory use the viewDidUnload to release objects you won't use while the view is not presented again. You can restore then in the viewDidLoad as well.

Upvotes: 1

Related Questions