views:

71

answers:

2

Hi,

Hope you all doing well, I am getting a memory leak while setting the font of UIButton. This is the code which I am using to set the font,

    [MyBtn.titleLabel setFont:[UIFont boldSystemFontOfSize:12]];

whereas MyBtn is connected to IBOoutlet and I am not allocating memory to it.

I don't see any thing wrong in the code. Hopefully someone will help me out, I will be really thankful.

Regards, Mohammad Salman

A: 

There is no leak just for this line of code.

It's possible that Instruments has a false positive because the fonts are cached (i.e. -retained by UIKit).

KennyTM
A: 

Thanks for reply,

In instrument the responsible library is UIKit whereas in extended detail it is pointing my code, Do you think I should go for apple technical support or submit my app ?

Mohammad Salman