爲了測試和編寫代碼,我需要重新啓動我的GameViewContrller重新啓動的ViewController
GameViewController *controller = [[GameViewController alloc] initWithNibName:@"GameViewController" bundle:nil];
[self presentModalViewController:controller animated:NO];
這種方法重啓的viewController但所有存儲在內存中,因爲我的行爲/過程正在進行,作爲與每個而不是應用程序內存增加重啓。 我認爲這不是正確的方法,並且想知道如何完全覆蓋viewController以便於內存,刪除所有進程並重新啓動。
更新
- (IBAction)restartButtonPress {
// GameViewController *controller = [[GameViewController alloc] initWithNibName:@"GameViewController" bundle:nil];
// [self presentModalViewController:controller animated:NO];
[self.view setNeedsDisplay];
}
wt你想要嗎? – iPatel 2013-03-23 10:49:18
假設我有一個遊戲場景(遊戲場景描述都在gameview控制器中),因爲我必須重新啓動,因爲數據被寫入文件,我該如何實現它? – user2037857 2013-03-23 10:57:11
你想重新啓動你的視圖? – iPatel 2013-03-23 10:58:11