1
泄漏應用程序告訴我,下面的函數導致內存泄漏,我找不到原因。pushViewController導致內存泄漏
-(void)viewGameList {
GameListController *gameListViewController = [[GameListController alloc] initWithNibName:@"GameListController" bundle:nil];
gameListViewController.rootController = self;
[self.navigationController pushViewController:gameListViewController animated:YES];
[gameListViewController release];
}
它告訴我,這行導致128字節內存泄漏。
[self.navigationController pushViewController:gameListViewController animated:YES];
我是否缺少明顯的東西?
聲明'.rootController'屬性的方式如何? – kennytm 2010-03-28 06:18:30
我不確定代碼是否會在評論中正確顯示,但這是GameListController.m中問題的答案: @class RootViewController; @interface GameListController:UIViewController { \t RootViewController * rootController; } @property(nonatomic,retain)RootViewController * rootController; 任何想法,爲什麼我會在這裏發生內存泄漏? – hookjd 2010-03-28 15:36:07