构建和分析工具Cocoa Xcode

时间:2010-11-03 11:09:35

标签: cocoa xcode memory-management

我今天第一次尝试了Xcode的Build and Analyze工具。 并在此功能中找到了一些东西

请查看图片:

enter image description here

-(IBAction)completeSessionButAct:(id)sender{
    NSDictionary *tempDic = [[NSDictionary alloc] initWithObjectsAndKeys:[self view],@"mainview",
                             congratulationScreen,@"screen",
                             congScreenLabel,@"cong_screen_label",
                             congScrStatusLabel,@"cong_scr_status_label",
                             [sender superview],@"last_screen",nil];
    [functionality completeSession:tempDic];
}

此功能从第64行开始,到第71行结束

任何人都可以解释一下这个功能中的内存泄漏。

1 个答案:

答案 0 :(得分:4)

图像中显示的文字对我来说似乎很清楚:你正在创建一个你拥有的对象(new,alloc,copy,retain [NARC]那样做);但你永远不会取消所有权。

请尝试使用+[NSDictionary dictionaryWithObjectsAndKeys:]