【发布时间】:2011-07-28 01:28:11
【问题描述】:
我在 viewController 中使用 UISegmentedControl。选择一个段后,我希望从 NSFetchedResultsController(已经设置)加载表的数据,而从另一个段中,我希望从数组加载数据。
我这里使用的是段的委托方法
- (void)segmentedControl:(SVSegmentedControl*)segmentedControl didSelectIndex:(NSUInteger)index
这里的问题是我似乎无法使用段的委托访问 tableView 数据源方法。
例如,如果在 didSelectRowAtIndexPath 方法中,我可以执行 if (selectedSegment == 1),然后 xxxxx 之类的操作,那就太好了。
有人知道我该怎么做吗?
当根据段选择行时,我想推送到不同的视图。
【问题讨论】:
标签: iphone cocoa-touch uitableview uisegmentedcontrol