我正在尝试将PKRevealController与Storyboard一起使用。这就是我的AppDelegate在启动时的看法
MainNavController* navController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil]instantiateViewControllerWithIdentifier:@"MainNavController"];
MainViewController* mainViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil]instantiateViewControllerWithIdentifier:@"MainViewController"];
LeftViewController* leftViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil]instantiateViewControllerWithIdentifier:@"LeftViewController"];
PKRevealController *revealController = [PKRevealController revealControllerWithFrontViewController:navController leftViewController:leftViewController];
revealController.animationDuration = 0.25;
revealController.delegate = self;
self.window.rootViewController = revealController;
所以这似乎工作正常,App推出没有问题,但是当我向右滑动时,左侧视图控制器显示然后崩溃并出现此错误:
'NSInvalidArgumentException',原因:' - [PKAnimation pk_identifier]:无法识别的选择器发送到实例
我不知道如何解决这个问题。
答案 0 :(得分:0)
这可能是输入错误。检查https://github.com/pkluz/PKRevealController/blob/master/Documentation/USAGE.md以查看如何正确导入,如果将其作为静态库导入,请确保重现所有步骤!