我建立一個應用程序和每個標籤欄項目包含4或有時5嵌套導航..我試圖做的每一個瘦但pushViewController導致儀器內存分配問題,我不知道我可以什麼做,, 代碼是pushViewController內存分配問題
[self.navigationController pushViewController:table animated:YES];
[table release];
table=nil;
我嘗試打印引用計數和我震驚
推之前引用計數= 1 和推後是= 4
爲什麼? 任何人都可以幫我嗎?
代碼是我用來啓動該表是
custemTable *table=[[custemTable alloc] initWithNibName:@"custemTable" bundle:nil ];
NSString selectedCellText=((custemCell)[tableView cellForRowAtIndexPath:indexPath]).THNameLabel.text;
cll=(custemCell)[tableView cellForRowAtIndexPath:indexPath];
cll.backgroundLabel.backgroundColor=[UIColor ];
[backgroundSelectedCell release];
backgroundSelectedCell=nil;
table.showingTill=selectedCellText;
[email protected]"...";
selectedCellText=nil;
[self.navigationController pushViewController:table animated:YES];
[table release];
table=nil;
真正的問題是,應用程序啓動時內存分配1.56 M和當我選擇的任何細胞和pushViewController工作記憶因爲2.8米,當我支持2.8 M的內存(有時約2.7或2.6),以知道..沒有內存泄漏,我是分配一切,我分配或保留或複製,我不能什麼我可以做!
可能更好編輯您的問題與代碼 – Rog 2010-11-29 08:28:46
親愛的杆..代碼是我用來發起表是 custemTable * table = [[custemTable alloc]; initWithNibName:@「custemTable」bundle:nil]; NSString selectedCellText =((custemCell)[tableView cellForRowAtIndexPath:indexPath])。THNameLabel.text; cll =(custemCell)[tableView cellForRowAtIndexPath:indexPath]; cll.backgroundLabel.backgroundColor = [UIColor]; [backgroundSelectedCell發佈]; backgroundSelectedCell =無; table.showingTill = selectedCellText; table.title = @ 「......」; selectedCellText =無; [self.navigationController pushViewController:table animated:YES]; [表格發佈]; [table = nil; – Adel 2010-11-29 08:34:16