アプリで発生しているメモリ リークを見つけようとしています。アプリケーションが読み込まれると、instuments のようなメモリ リークがすぐに発生します。
どうすればそれをデバッグできますか? アプリをどれだけ長く実行しても、何をしても、アプリケーションがロードされたときにのみ再現されません。
これがデリゲートの私のコードです
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
tabBarController = [[UITabBarController alloc] init];
search = [[iPhoneView alloc] initWithNibName:@"iPhoneView" bundle:nil];
homeNavigationController = [[UINavigationController alloc] initWithRootViewController:search];
favouritesNavigationController = [[UINavigationController alloc] init];
favoritesViewController = [[FavoritesViewController alloc]init];
[favouritesNavigationController pushViewController:favoritesViewController animated:NO];
aboutUsViewController =[[AboutUsViewController alloc] init];
UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"toolbox" image:[UIImage imageNamed:@"aboutus"] tag:0];
aboutUsViewController.tabBarItem = item;
[item release];
UITabBarItem *item2 = [[UITabBarItem alloc] initWithTitle:@"αγαπημένα" image:[UIImage imageNamed:@"favorites"] tag:0];
favouritesNavigationController.tabBarItem = item2;
[item2 release];
NSArray *tabBarControllerCollection = [NSArray arrayWithObjects:homeNavigationController,favouritesNavigationController,aboutUsViewController,nil];
[tabBarController setViewControllers:tabBarControllerCollection animated:NO];
[window setRootViewController:tabBarController];
[tabBarControllerCollection release]; //added that for the leaks
//[window addSubview:tabBarController.view]; for the warning thing about window and root view controller
[window makeKeyAndVisible];
}
- (void)dealloc {
[tabBarController release];
[search release];
[favoritesViewController release];
[favouritesNavigationController release];
[aboutUsViewController release];
[window release];
[super dealloc];
}