ExploreViewController という RootView があります
ここで、次のサブビューをロードします。[self.view addSubview:self.wallPostsTableViewController.view];
これは正常に機能していますが、セルをヒットしてその販売の詳細情報を開きたいと思います。通常、didSelectRowAtIndexPath で prepareToSegue と preformSegue を使用します...
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// call super because we're a custom subclass.
[super tableView:tableView didSelectRowAtIndexPath:indexPath];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[self performSegueWithIdentifier:@"ExploreModalSegue" sender:self];
}
と
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"ExploreModalSegue"]) {
MuseumViewController *detailViewController = [segue destinationViewController];
NSInteger row = [[self tableView].indexPathForSelectedRow row];
detailViewController.detailItems = [self.objects objectAtIndex:row];
}
}
エラーが発生します:
キャッチされない例外 'NSInvalidArgumentException' が原因でアプリを終了しています。理由: 'Receiver () には識別子 'ExploreModalSegue' のセグエがありません'
そのセルの正しい情報で detailViewController を呼び出す必要があり、その detailViewController に StoryBoard を使用したいですか?