【发布时间】:2014-04-04 10:06:09
【问题描述】:
我正在用一些小游戏制作一个小游戏。在 1.VC 上,我在 scrollView 中有 UIButtons 来选择迷你游戏。当 miniGame 被加载(UIVC)时,它会加载一个带有所选 SKScene 游戏的 SKView。
这是我的应用视图设置:
1.
UIViewController -> 1.1. ScrollView -> 1.1.1. UIButton -> 1.1.1.1. UIViewController -> 1.1.1.1.1. SKView -> 1.1.1.1.1.1. SKScene (the 1. mini game).
In the 1.1.1.1. VC I have a backButton (UIButton) which returns me back to the 1.VC.
Since I added the backButton in 1.1.1.1.VC I can always return at any moment in the first mini game to 1.VC.
问题: 从 1.1.1.1 返回的唯一方法。 (或更深)到 1. 是通过单击 UIButton。我想以编程方式返回。当 endGameVC(一个 SKScene)出现时,我希望它自动“排序”或“呈现”回 1.VC(使用 NSTimer)。
到目前为止我已经尝试过:
1.
[self.view removeFromSuperview];
结果: 黑屏 - 从这里不能做任何事情
2.
[self.view presentScene:nil];
结果:灰屏 - 我删除了 skview 并可以通过单击按钮返回
3.
[self.view removeFromSuperview];
[self.view addSubview:[[WBMGamesDataManager sharedInstance] tempy]];
结果:
-[WBMMainVC superview]: unrecognized selector sent to instance 0x9ac4c30
2014-04-04 11:54:06.317 KinderApp[1940:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WBMMainVC superview]: unrecognized selector sent to instance 0x9ac4c30'
...我尝试过的其他东西并没有让我有所收获。
欢迎任何想法或解决方案。如果你知道我做错了什么,或者如果整个方法有问题,我对 cmets/critics 持开放态度。谢谢你:)。
【问题讨论】:
标签: objective-c ios7 uiview uiviewcontroller sprite-kit