Hope you all doing well, I am getting a memory leak while s开发者_运维百科etting 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
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. -retain
ed by UIKit).
精彩评论