开发者

sizeWithFont memory leak in iphone

I have this code:

[[data objectForKey:[keys objectAtIndex:0]]
                     sizeWithFont:[UIFont systemFontOfSiz开发者_StackOverflowe:12]  
                     constrainedToSize:CGSizeMake(276.0, 1000.0)  
                     lineBreakMode:UILineBreakModeTailTruncation];

data is a NSDictionary.

It is said this code has 16 bytes leak, but I cant find it.

Help


What type does the NSDictionary return?

[[data objectForKey:[keys objectAtIndex:0]]

Break the statement up to better figure out where the leak may be:

NSString *s = [[data objectForKey:[keys objectAtIndex:0]];
CGSize size = [s sizeWithFont:[UIFont systemFontOfSize:12]
            constrainedToSize:CGSizeMake(276.0, 000.0)
                lineBreakMode:UILineBreakModeTailTruncation];


Do you leak only one 16byte block for the entire life of your app? Or are you leaking 16 bytes every time through a loop?

If it is 16 bytes only, I am not sure if I'd worry too much about it. I'm saying that given that some of the caching I have seen done by the OS tends to look like leaking.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜