IOS 4.3 UINavigationBar tintColor Leaks

nmn*_*mnm 10 iphone objective-c ios4

在IOS4.3中,如果我设置

navigationBar.tintColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1];
Run Code Online (Sandbox Code Playgroud)

我会得到内存泄漏:UIDeviceRGBColor泄漏

但如果我使用navigationBar.tintColor = [UIColor blackColor]; 一切都很好.

这在ios4.2中从未发生过

我做了一些调试,[navigationBar.tintColor retainCount]如果我使用,我发现它看起来更大

[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1];
Run Code Online (Sandbox Code Playgroud)

有没有人有同样的问题?

这是泄漏代码:
在RootViewController中:

- (void)viewWillAppear:(BOOL)animated { 
        self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0];
        [super viewWillAppear:animated];
    } 
Run Code Online (Sandbox Code Playgroud)

在DetailViewController中:

- (void)viewWillAppear:(BOOL)animated {
        self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.9 green:0 blue:0 alpha:0];
        [super viewWillAppear:animated];
    } 
Run Code Online (Sandbox Code Playgroud)

如果你去DetailViewController,然后回弹到RootViewController,在Instruments中你可以看到UIDeviceRGBColor泄漏

Mos*_*she 0

尝试使用构建和分析(或在 Xcode 4 中分析)并确保您不会首先在其他地方泄漏。)如果您仍然看到问题,请向 Apple 提交错误报告。