UITableViewController UINavigationController

时间:2015-11-01 13:28:42

标签: uitableview uinavigationcontroller unrecognized-selector

enter image description here

我声明了一个GamePicerViewController(UITableViewController的子类)。但是我在prepareForSegue:sender:方法中遇到了一个错误。控制台说gamePickerViewController是一个UINavigationController。有什么想法吗?

我在pic abve中发布了GamePickerViewController.h PlayerDetailsViewController.m和控制台。

1 个答案:

答案 0 :(得分:0)

问题解决了。

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"PickGame"]) {
        UINavigationController *controller = segue.destinationViewController;
        GamePickerViewController *gamePickerViewController = [controller viewControllers][0];
        gamePickerViewController.delegate = self;
        gamePickerViewController.game = _game;
    }
}

我忘记了这句话:

        UINavigationController *controller = segue.destinationViewController;