我正在製作一款小遊戲,少數迷你遊戲。在1.VC上我有一個scrollView裏面的UIButton來選擇迷你遊戲。當miniGame被加載(一個UIVC)時,它會加載一個帶有所選SKScene遊戲的SKView。
這是我的應用程序的查看設置:如何從SKView訪問IBAction?
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)時,我希望它自動地「seque」或「呈現」回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'
...我試過沒有得到任何地方我其他的東西。
歡迎任何想法或解決方案。如果你知道我做錯了什麼,或者如果整個方法很腥,我都會接受評論/批評。謝謝 :)。