Sam Luther Sam Luther - 1 year ago 83
Objective-C Question

prepareForSegue not called in embedded segue

I have a table view controller embedded in a container in a view controller.

In both the view and table view controllers prepareForSegue method I put NSLog(@"name of the controller")
I see a log for the view controller but not the table view controller. Shouldn't I also see the nslog for my table view's prepareForSegue?

enter image description here

Answer Source

In Your Log Frame View Controller prepareForSegue will be called directly after initWithCoder: to prepare your TableViewController. I cannot see your connection between table view controller and another view (view on the right) but I believe it will be called when you hit the row.


The other thing could be that you haven't add UINavigationController on the view hierarchy and you set up your segue style to 'push'. Try change style of your segue to 'modal' in attribute inspector. Hope this help.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download