私はxcode4で計測器を動かし、次のコードで2つのリークがあったと教えてくれました(****
と記されています)。私はptでコードを使ってメモリ解放を世話したと思った。 Aとpt。 B.pushViewControllerの周りにこのメモリリークを修正するには?
ここでいくつかの関連トピックを読みましたが、それを修正する理由と方法をまだ理解できませんでした。
もう1つの質問は、 Aが必要です。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//Get the dialog id
NSDictionary *rowData = [dialogs objectAtIndex:indexPath.row];
NSInteger dialogId = [[rowData objectForKey:@"id"] intValue];
DialogViewController *detailViewController = [[DialogViewController alloc] initWithNibName:@"DialogViewController" bundle:nil];
detailViewController.dialogId = dialogId;
NSString *title = [NSString stringWithFormat:@"%d. %@", [[rowData objectForKey:@"id"] intValue], [rowData objectForKey:@"title"]];
****** i 6.8%
[detailViewController.dialogTitle release]; // pt. A
detailViewController.dialogTitle = [title retain];
[self.navigationController pushViewController:detailViewController animated:YES];
****** i 93.2%
[detailViewController release]; // pt. B
}
ありがとうございます! 呂
rekle、ありがとうございます!だから、なぜXcode4のリークツールがpt.Bにリークとしてフラグを立てているのか知っていますか?それを偽陰性とするか、DialogViewControllerにリークがある可能性がありますか?何をお勧めしますか? –