【发布时间】:2012-07-14 00:32:28
【问题描述】:
我在集成 Greystripe 广告时遇到了一些问题(记录在 here 但并不重要)。如果像这样展示我的游戏视图,可以解决我的问题
iSlideAppDelegate *appDelegate = (iSlideAppDelegate *)[[UIApplication sharedApplication] delegate];
UIStoryboard *storyboard = self.storyboard;
Game3ViewController *gameView = (Game3ViewController *)[storyboard instantiateViewControllerWithIdentifier:@"mainGameController"];
[appDelegate.window addSubview:gameView.view];
这基本上只是将我的游戏视图添加到当前视图控制器之上。
现在我想从这个视图中显示另一个像这样的模态视图
FullScreenSelfAdViewController *adView = [[FullScreenSelfAdViewController alloc] initWithNibName:@"FullScreenSelfAdViewController" bundle:nil];
[adView setDismissDelegate:self];
[self presentModalViewController:adView animated:YES];
问题是,当显示此视图时,我的 gameView 会释放。这意味着当我调用解除它的 AdView 时,它会释放但仍留在屏幕上,因为底层的 gameView 不再存在。
有没有更好的方法来调用这些视图? (我不能通过将它呈现为模态视图来调用我的游戏视图)。 或者有一种方法可以防止 gameView 被释放?
【问题讨论】:
标签: ios xcode cocoa-touch uiviewcontroller modalviewcontroller