开发者

Build and Analyze tool Cocoa Xcode

I tried Build and Analyze tool of Xcode very first time today. and found some thing in this function

Please check the image:

Build and Analyze tool Cocoa Xcode

-(IBAction)completeSe开发者_StackOverflow中文版ssionButAct:(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];
}

this function start from line 64 and end at 71

Can Any one explain me the memory leakage in this function.


The text as displayed in the image seems pretty clear to me: You are creating an object that you own (new, alloc, copy, retain [NARC] does that); but you never rescind ownership.

Try using +[NSDictionary dictionaryWithObjectsAndKeys:] instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜