开发者

Build and Analyze tool Cocoa Xcode

开发者 https://www.devze.com 2023-01-23 12:09 出处:网络
I tried Build and Analyze tool of Xcode very first time today. and found some thing in this function Please check the image:

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

精彩评论

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

关注公众号