sha*_*eck 3 objective-c uinavigationcontroller uiviewanimationtransition
我正在构建一个iPhone应用程序,我已经实现了一个关于应用程序主题的知识库部分.我使用了表视图和导航viewController,以便在选择表中的任何单元格时,将创建一个新的视图控制器并将其添加到导航堆栈中.
我试图自己实现curl up/down动画但是我在运行时遇到这个错误
父视图控制器在调用时使用遗留包含 - [UIViewController transitionFromViewController:toViewController:duration:options:animations:completion:]'
这是代码示例
(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
// change the accessory button to activity indicator
UITableViewCell *cell = [mTableView cellForRowAtIndexPath:indexPath];
SomeViewController *ad = [[SomeViewController alloc] initWithNibName:@"SomeViewController" bundle:[NSBundle mainBundle]];
ad.title = cell.textLabel.text;
[self.navigationController addChildViewController:ad];
[self.navigationController transitionFromViewController:self toViewController:ad duration:0.7 options:UIViewAnimationOptionTransitionCurlUp animations:^{} completion:^(BOOL completed){
[ad release];
}];
Run Code Online (Sandbox Code Playgroud)
非常感谢任何帮助,建议和提示!谢谢!
嘿,当我的自定义包含视图控制器是UINavigationViewController的子类时,我得到了相同的异常.当我将我的收容vc作为UIViewController的子类时,它就像一个魅力.你的问题可能会有所不同.来自苹果文档:
此方法仅用于通过自定义容器视图控制器的实现来调用.如果重写此方法,则必须在实现中调用super.
您在UINavigationViewController实例上调用此方法,而不是在自定义容器视图控制器的实例上调用此方法.
| 归档时间: |
|
| 查看次数: |
2279 次 |
| 最近记录: |