2
このコードを使用して現在のビューから別のビューに移行しています。問題は、現在のビューに戻るときにアプリがクラッシュすることです。他のビューへのトランジション、トランジションバック時のクラッシュ
これは私が新しいものに現在のビューから渡すために使用したコードです:
CATransition *transition = [CATransition animation];
transition.duration = 0.75;
// using the ease in/out timing function
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionReveal;
transition.subtype = kCATransitionFromRight;
transition.delegate = self;
// Next add it to the containerView's layer. This will perform the transition based on how we change its contents.
[self.view.layer addAnimation:transition forKey:nil];
// Here we hide view1, and show view2, which will cause Core Animation to animate view1 away and view2 in.
self.view.hidden = YES;
MyMessages *info1=[[MyMessages alloc] initWithNibName:@"MyMessages" bundle:nil];
[self.view addSubview:info1.view];
info1.view.hidden = NO;
self.view.hidden = NO;
私はこのコードを使用して返すようにしてみてください。
CATransition *transition = [CATransition animation];
transition.duration = 0.75;
// using the ease in/out timing function
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionReveal;
transition.subtype = kCATransitionFromLeft;
transition.delegate = self;
// Next add it to the containerView's layer. This will perform the transition based on how we change its contents.
[self.view.layer addAnimation:transition forKey:nil];
// Here we hide view1, and show view2, which will cause Core Animation to animate view1 away and view2 in.
self.view.hidden = YES;
FirstViewController *info1=[[ FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
[self.view addSubview:info1.view];
info1.view.hidden = NO;
self.view.hidden = NO;