【发布时间】:2012-11-21 09:28:30
【问题描述】:
你好 stackoverflow 的家伙!
我遇到了一个问题,我不知道如何解决它...
我有一个带有 UINavigationController 的 StoryBoard,它有一个 UIViewController 作为 RootViewController。在这个 RootViewController 中,我有 2 个 UIButton。
第一个 UIButton instantiateViewControllerWithIdentifier 一个 UICollectionViewController 很好用。
第二个 UIButton instantiateViewControllerWithIdentifier 一个 UIViewController,它有 2 个 UITableView。这是我实例化 UIViewController 时的问题,我的 2 UITableView 加载良好,但是当我触摸它(滚动)时出现此错误:
-[__NSCFType scrollViewDidScroll:]: unrecognized selector sent to instance 0x752ff90
2012-11-21 10:22:49.300 Month[19992:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType scrollViewDidScroll:]: unrecognized selector sent to instance 0x752ff90'
但是当我把它做成 RootViewController 时,一切都如我所愿......所以只有当 RootViewController 实例化我的 UIViewController 时,我才会崩溃。
这就是我在按下 UIButton 时实例化 UIViewController 的方式:
DayViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"calendarDay"];
希望您能帮助我了解这些信息。
问候,
【问题讨论】:
标签: uitableview uiviewcontroller initialization storyboard