开发者

Memory leak in UIButton setFont

开发者 https://www.devze.com 2023-01-12 05:01 出处:网络
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,

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. -retained by UIKit).

0

精彩评论

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