我在我的應用程序中有大約9個ViewControllers
。我打開使用presentModalViewController
ViewControllers。每次用戶輸入背景並顯示前景時,我都想顯示第一個ViewController。如果用戶在第8個ViewController中輸入背景並再次打開該應用程序,則需要顯示第一個視圖控制器。應用程序中的內存泄漏WillEnterForeground
我使用以下代碼applicationWillEnterForeground
- (void)applicationWillEnterForeground:(UIApplication *)application
{
self.HomeScreenViewController = [[HomeScreenViewController alloc] initWithNibName:@"HomeScreenViewController" bundle:nil];
self.window.rootViewController = _homeScreenViewController;
[self.window makeKeyAndVisible];
}
,它是示出了內存泄漏。顯然它會顯示內存泄漏,因爲我再次初始化HomeCtrl,但我不知道如何解決它。誰能幫我 ?? 我沒有使用UINavigationController
,因爲ViewControllers是從右側或左側推入的。
是否使用ARC? – Kreiri 2012-08-09 10:51:20
不,我不使用。 – Cyril 2012-08-09 10:52:02