IOS 4.3 UINavigationBar tintColor Leaks

前端 未结 5 1212
暗喜
暗喜 2020-12-16 18:28

In IOS4.3 if I set

navigationBar.tintColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1];

I will get a memory leak: UIDeviceRGBC

5条回答
  •  一个人的身影
    2020-12-16 19:03

    First, do not use retainCount. It is useless.

    Next, how do you know you have a leak? Did you use instruments? Finally, did you turn on retain event tracking in the allocations instrument and see where all retain/releases are being sent?


    +blackColor is a singleton. Thus, you are likely leaking it, too, but there is only one and leaks won't find it since it is referenced by a global.

    As for your leak, it doesn't matter if it only happens in iOS 4.3 vs. 4.2. A leak is a leak. While there is a chance it is in the Apple frameworks, that isn't likely. However, if so, a bug report is highly appreciated.

    Also, use the Allocations instrument to see if you are accreting other objects that are not showing up as leaks (but still shouldn't be around). Leaks only detects unreferencable objects, but there are many other ways to leak memory!

提交回复
热议问题