【发布时间】:2014-02-02 13:57:14
【问题描述】:
我的应用目前遇到问题。 我有一个嵌入在 TabBarController 中的 NavigationController 中的 UICollectionViewController。
基本上,我有一个用户集合,当我点击它时,我想进入详细视图。
当我尝试执行 segue 时,发生崩溃,并且我收到消息:“*** 由于未捕获的异常 'NSInvalidArgumentException' 导致应用程序终止,原因: '不支持推送导航控制器'"
我的故事板结构如下所示:
UITabBarController -> UINavigationController -> UICollectionViewController -> UiViewController
@interface AnnuaireCollectionViewController : UICollectionViewController
@property (strong, nonatomic) NSMutableArray *photos;
@property (strong, nonatomic) NSMutableArray *noms;
@property (strong, nonatomic) NSMutableArray *users;
@property (strong, nonatomic) IBOutlet UICollectionView *collection;
@end
我的preparForSegue方法:
#pragma mark - Prepare for Segue
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
UICollectionViewCell *cell = (UICollectionViewCell *)sender;
NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];
UserDetailViewController *userDetailViewController = (UserDetailViewController *)segue.destinationViewController;
userDetailViewController.userImage = [UIImage imageNamed:[self.photos objectAtIndex:indexPath.row]];
userDetailViewController.user = [self.users objectAtIndex:indexPath.row];
}
故事板: http://i.stack.imgur.com/856Iq.png
我查看了苹果文档上的示例代码,一切似乎都相似,我不明白为什么会出现此错误。
我哪里做错了?
谢谢!
【问题讨论】:
标签: ios objective-c uinavigationcontroller