Reputation: 1979
scrollView
using storyboard.UITableViewControllers
) inside the scrollViewController
, So I can use panGesture
to switch between tables. and it's working fine.tableViewController
using storyboard, set myController to be the corresponding view controller.tableViewController
in navigation controller.when running the app, prepareForSegue:
is never called.
Edit: After noticing this issue, I did the follow thing but with no luck.
I also set the segue identifier in storyboard correctly. and add the following code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"segueIdentifier" sender:self];
}
but when I tap any table cell on screen, program will crash with following error:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver () has no segue with identifier 'segueIdentifier'' * First throw call stack:
Why is that?
Upvotes: 2
Views: 1398
Reputation: 9
I think your problem here "5. Control drag from table cell to a new view controller to create a push segue."
Try drag from your view controller (not your table cell) to new view controller and create push segue, then try with
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"segueIdentifier" sender:self];
}
Upvotes: 1