0

My Swift app crashes when I have about 4 view controllers on my navigation stack and then at the 4th I call popToRootViewController. It pops, so I know the UINavigationController exists, but the app crashes without any error other than Exc Bad Access. It also crashes when I dismiss the UINavigationController instead of popping to root view controller.

Note: This happens only when running app on my test device. When my it's ran while my test device is connected to Xcode, it never crashes.

This is the only code in my final view controller, other than viewDidLoad of course. Code: @IBAction func closeBtnPressed(sender: AnyObject) { //dismissViewControllerAnimated(true, completion: nil) self.navigationController?.popToRootViewControllerAnimated(true) }

Any ideas? Thanks!

justColbs
  • 1,504
  • 2
  • 18
  • 28
  • can you post the code you have – Lamour Oct 06 '15 at 19:24
  • please post the required code, so that we can help easily – AAA Oct 06 '15 at 19:47
  • posted code! Thanks1 – justColbs Oct 06 '15 at 21:06
  • Please upload your project to GitHub so it is possible to run it and see what's wrong. Otherwise it will be very difficult to assist you. If you cannot upload the original project - create a sample one which will illustrate this problem. While making it you might also discover the reason for this bug ;) – Andriy Gordiychuk Oct 07 '15 at 00:15

0 Answers0