I've recently updated my app from iOS 8.3 to iOS 9. After fixing the various errors with the code, I managed to compile the app and run it, when I noticed the following problem.
When I perform a segue clicking, for example, an UIButton, the view loaded with the segue appear with the animation of a modal view (sliding from bottom until it reaches top), but in the storyboard the segue is Show (e.g. Push)
. In addition, the back button from the navigation controller doesn't appear anymore.
The console print this when I perform a segue:
Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (<UISearchController: 0x7ffde14866b0>)
The problem seems to be present only in a view, when loading other views, I tried to set other views as Initial View Controller and all works.
Add a button on the current screen. Then press control and drag the button to the target screen. Then select push. And when you will tap the button the screen will be switched to the target screen.
Right-click the control or object in your current view controller. Drag the cursor to the view controller you want to present. Select the kind of segue you want from the list that Xcode provides.
After taking a look at the Storyboard in the project, I discovered that the problem was due to extra navigation controllers after each Push segue. That is, in addition to the initial (root) navigation controller, the Storyboard contained a UINavigationController
as the destination for the problematic Push segues. Removing these extra navigation controllers (but keeping the root navigation controller) solved the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With