Xcode5 iOS7 Segues + popViewControllerAnimated =破解过渡

时间:2013-09-26 00:41:34

标签: storyboard ios7 segue xcode5 popviewcontrolleranimated

所以我从另一个开发者手中接过了一个应用程序,iOS 6中的生活很糟糕。不幸的是,他们使用了Storyboard + Segues来控制应用程序的导航,这完全是一团糟。我在iOS7上遇到的问题是当用户经历一些段落并完成时,应用程序尝试使用popViewControllerAnimated向后导航。

此代码导致错误:

    ((PhotoCaptureViewController*) self.navigationController.viewControllers[self.navigationController.viewControllers.count - 2]).editedImage = _image;
    ((PhotoCaptureViewController*) self.navigationController.viewControllers[self.navigationController.viewControllers.count - 2]).popBack = YES;

    [self.navigationController popViewControllerAnimated:YES];

此代码似乎向后导航很好:

[self.navigationController popViewControllerAnimated:YES];

显然我不认为铸造&通过navigationController的viewController数组的技巧是一个好主意(特别是没有内省),但为什么这只会导致iOS7中的问题?在Apple's iOS 7 Api Diffs我没有看到popvisControllerAnimated被弃用,所以我很茫然。

我甚至不会提到如何搞砸故事板的布局,我会在周末修理那个PITA。

0 个答案:

没有答案