- C/C++ code
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UINavigationController *navigationController = [[tabBarController viewControllers] objectAtIndex:0]; PlayerViewController *playerViewController = [[navigationController viewControllers] objectAtIndex:0]; playerViewController.players = players; return YES;
用的Stroryboard
TabBar->Nav(包含TableView)
照着示例写的,可是运行报错。
报错:iphone program received signal:"SIGABRT"
位置:
PlayerViewController *playerViewController =
[[navigationController viewControllers] objectAtIndex:0];
------解决方案--------------------
看下[navigationController viewControllers] 返回的NSArray 中的object数量是不是0 或者是nil