【发布时间】:2014-02-14 03:05:30
【问题描述】:
您将如何在情节提要中实现 tableView didSelectRowAtIndexPath。我已经创建了一个创建表的视图控制器。当单击表格中的每个单元格时,我不知道在情节提要中如何使视图转换。
这是我最初以编程方式在该方法中的内容:
Show *show = [self.shows objectAtIndex:indexPath.section];
ShowContentItem *showItem = show.showContentItems[indexPath.row];
if ([showItem.contentType isEqualToString:@"Headline_Section"]) {
HeadlinesViewController *headlinesVC = [[HeadlinesViewController alloc] init];
headlinesVC.shows = [[NSMutableArray alloc] initWithObjects:show, nil];
[self.navigationController pushViewController:headlinesVC animated:YES];
} else {
NSInteger contentIndex = [self.storyPostContent indexOfObject:showItem];
NSRange rangeForView = NSMakeRange(contentIndex, [self.storyPostContent count] - contentIndex );
ShowContentViewController *showContentVC = [[ShowContentViewController alloc] init];
showContentVC.contentList = [self.storyPostContent subarrayWithRange: rangeForView];
[self.navigationController pushViewController: showContentVC animated:YES];
}
我将如何专门更改上面的代码以使用情节提要?
【问题讨论】:
-
在您的故事板中,您将表格配置为静态填充还是动态填充?
-
动态填充。
-
您是否配置了一个类以符合UITableViewDelegate 协议,并将表的委托属性链接到该类?
-
是的,我已经完成了。
标签: ios user-interface storyboard