查看新视图不会得到旧视图的后退指针

时间:2012-03-18 03:21:27

标签: objective-c ios5 xcode4.2 transition segue

我正在尝试构建自定义segue,但我似乎无法获得正确的过渡。我想要的转换是模态segue与默认转换的相反转换。所以我想要的转换就是我的视图向下滑动以显示新视图。我的自定义segue的代码发布在下面。

@implementation customSegue

//still need to find the right transition (from top to bottom)
- (void) perform 
{

UIViewController *src = (UIViewController *) self.sourceViewController;
UIViewController *dst = (UIViewController *) self.destinationViewController;

[UIView transitionWithView:src.navigationController.view duration:0.5
                   options:UIViewAnimationOptionTransitionCurlUp
                animations:^{
                    [src.navigationController pushViewController:dst animated:NO];
                }
                completion:NULL];

} 
@end

1 个答案:

答案 0 :(得分:1)

导航控制器没有自己的视图 - 它的视图是当前视图控制器的视图。尝试使用src.view代替src.navigationController.view