I have an app which is structured like below.
- First the User logs in with his credentials.
- Then chooses few selection criteria (ex:Ticket details)
- A table view appears and shows the brief details of the ticket.
- A push segue from table view based upon the selection will show the detailed view.
Here I have added a navigation controller for the table view and tried keeping it as the root view controller. Also, I tried having my first view controller as root view folder.
The error msg is:
* Terminating app due to uncaught exception 'NSGenericException', reason: 'Could not find a navigation controller for segue 'TicketDetailSegue'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.' * First throw call stack:
Below is my code on Segue:
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if ([segue.identifier isEqualToString:@"TicketDetailSegue"]) {
UITableViewCell *cell=(UITableViewCell *)sender;
NSIndexPath *ip= [self.tableView indexPathForCell:cell];
Ticket *T=[self.TicketsFinal objectAtIndex:ip.row];
ViewFour *pdvc=(ViewFour *)segue.destinationViewController;
pdvc.ticket=T;
}}
Note: My NavigationController cannot be the initial controller. Can someone suggest a solution? Any help is much appreciated.