【发布时间】:2013-06-20 13:44:26
【问题描述】:
错误信号 SIGABRT NSInvalidArgumentException',原因:'UICollectionView 必须使用非零布局参数初始化'。
当 UITableViewCell 被按下时,它应该显示 UICollectionView
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIViewController *viewController;
switch (indexPath.row) {
case IMAGE:
viewController = [[[CollectionViewController alloc] init] autorelease];
[self.CollectionViewController registerClass:[UICollectionViewCell class]forCellWithReuseIdentifier:@"Cell"];
case PROCEDURAL:
viewController = [[[ProceduralExampleViewController alloc] init] autorelease];
break;
default:
viewController = [[[UIViewController alloc] init] autorelease];
}
[self.navigationController pushViewController:viewController animated:YES];
}
使用故事板文件进行集合视图segue。
如何解决这个错误UICollectionView 必须用非零布局参数初始化
感谢您的帮助。
【问题讨论】:
-
也许你应该看看这个类似的问题:stackoverflow.com/questions/15270058/…
-
你是如何合成你的 UICollectionView 的?
-
在tableviewcontroller中声明uicollectionview的属性不是IBOutlet它
-
昨天试过这样的代码 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIViewController *viewController;switch (indexPath.row) {case IMAGE: viewController = [ [[CollectionViewController alloc] init] autorelease];[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"myCell"];但没有成功
标签: iphone objective-c uitableview ios6 uicollectionview