gpt4 book ai didi

iphone - ViewControllers 之间的转换不起作用

转载 作者:行者123 更新时间:2023-11-28 22:43:17 25 4
gpt4 key购买 nike

所以我得到了这个按钮,它带有一个推送到 StartViewControllerif 语句。我在这个 View Controller 的 viewDidLoad 中做了一个 NSLog@"transition successful" 来检查是否进行了转换。

在日志中它显示转换成功但在屏幕上未进行转换。

代码如下:

-(IBAction)initialButton:(id)sender {
NSLog(@"initialButton clicked");

if([userEmail.text length] <4)
{
[WCAlertView showAlertWithTitle:@"Email is empty" message:@"You haven't entered an email yet. Please enter one so we can sent you the shipping labels." customizationBlock:^(WCAlertView *alertView) {
alertView.style = WCAlertViewStyleBlackHatched;
} completionBlock:^(NSUInteger buttonIndex, WCAlertView *alertView) {
if (buttonIndex == 0) {
NSLog(@"Cancel");
} else {
NSLog(@"Ok");
}
} cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
}
else
{

StartViewController *startViewController = [[StartViewController alloc] init];
self.transitionController = [[[TransitionController alloc] initWithViewController:startViewController] initWithNibName:@"StartViewController" bundle:nil];
[initialViewController.view removeFromSuperview];
self.window.rootViewController = self.startViewController;

}


}

这是日志:

2012-12-14 09:22:55.431 Janssenpakketapp[24165:c07] initialViewController loaded
2012-12-14 09:23:04.021 Janssenpakketapp[24165:c07] initialButton clicked
2012-12-14 09:23:06.116 Janssenpakketapp[24165:c07] Ok
2012-12-14 09:23:11.909 Janssenpakketapp[24165:c07] initialButton clicked
2012-12-14 09:23:11.911 Janssenpakketapp[24165:c07] transition succesful

最佳答案

新更新:这应该有效:

StartViewController *startViewController = [[StartViewController alloc] init];
[[UIApplication sharedApplication].delegate.transitionController transitionToViewController:startViewController withOptions:UIViewAnimationOptionTransitionFlipFromRight];

关于iphone - ViewControllers 之间的转换不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13875075/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com