ビューから実行するアプリデリゲートで関数を作成しましたが、戻って関数を再度実行すると、
<ResultViewController: 0x757dfc0> on <ViewController: 0x71325c0> whose view is not in the window hierarchy!
エラー
アプリデリゲートコードがビューコントローラーを開いています
コードは
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
ViewController *view1 = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
[self.window setRootViewController:view1];
[self.window makeKeyAndVisible];
return YES;
}
-(void)specify
{
ResultViewController *res = [[ResultViewController alloc]init];
CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[self.window.layer addAnimation:transition forKey:nil];
[self.window.rootViewController presentModalViewController:res animated:NO];
}