1
私のアプリケーションで1つのリークの問題があります。私は色の自動解放オブジェクトを作成していますが、問題はそこにあります。drawRectメソッドがリークを引き起こしました
Malloc 1 04:12.221.102 32 UIKit +[UIColor allocWithZone:]
Autorelease <null> 04:12.221.107 0 TurfNutritionTool_ver_5.1 -[UINavigationBar(CustomImage) drawRect:]
Retain 2 04:12.221.125 0 UIKit -[UINavigationBar setTintColor:]
Release 1 04:12.226.279 0 Foundation -[NSAutoreleasePool release]
Retain 2 04:18.697.490 0 UIKit -[UINavigationButton setTintColor:]
Retain 3 07:35.584.218 0 UIKit -[UINavigationBar setTintColor:]
Release 2 07:35.584.225 0 TurfNutritionTool_ver_5.1 -[UINavigationBar(CustomImage) drawRect:]
Release 1 08:30.378.434 0 UIKit -[UINavigationButton setTintColor:]
これは、私はあなたたちは、私が今まで見つけることができませんよ、問題を見つけることを願って私のコード
@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed: @"toolbar_bkg.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
self.tintColor = [UIColor colorWithRed:0.913 green:0.725 blue:0.070 alpha:1.000]; //Yellow color
}
@end
です。
tintColor宣言のコードを表示できますか? –
@PeterKelly 'tintColor'はUINavigationBarのプロパティです。 – Caleb
@Calebもちろん、それは私の答えを参照してください。 –