views:

168

answers:

3

I have this code:

[[data objectForKey:[keys objectAtIndex:0]]
         sizeWithFont:[UIFont systemFontOfSize: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

+2  A: 

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];
zaph
A: 

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.

mahboudz
A: 

it has 16 bytes every time when I call this...

Zheng