0

I have a tabBarController with 5 tabs the third tab is a navigation controller with TableViewController as the root view controller.

When I press on a row on the table view it push a detail view (regular view controller) about the selected row.

The problem is first time parentViewController and presentingViewcontroller properties (in the details page) are set, all other consecutive both properties are set to nil.

The storyboard (auto layout is disabled)

EDIT I created a single tab application with navigation controller same as the one in the picture but I did not disable auto layout in the storyboard, every time parentViewController is set correctly.

I believe this is a bug if you disabled auto layout.

Mahmoud Fayez
  • 3,398
  • 2
  • 19
  • 36

1 Answers1

1

You are neither creating a child view controller, nor presenting a modal.

(Pushing a detail view controller onto a navigation controller's stack is kind of like adding a child, but navigation controllers predate the parent/child view controller mechanism, so they don't use it.)

What you need to check is the navigationController property of your detail view controller. That should be non-nil if it was pushed onto a navigation controller stack.

Duncan C
  • 128,072
  • 22
  • 173
  • 272