我正在使用工具的泄漏工具。它说我在init方法中有一些泄漏。它显示NSMutableArray泄漏。我在init中有一些泄漏。我看到没有人泄漏
我没有看到任何泄漏。
@interface BookSettings : NSObject
@property (nonatomic, retain) NSString *title;
@property (nonatomic, retain) NSMutableArray *authors;
@end
- (id)init
{
self = [super init];
if(self)
{
title = [[NSString stringWithString:@""] retain];
authors = [[NSMutableArray alloc] init];
}
return self;
}
- (void)dealloc
{
[title release];
[authors release];
[super dealloc];
}
我使用了一些库,例如ASIHHTP,它不支持ARC。这就是为什么我不使用ARC。 – Voloda2 2012-04-09 13:10:29
ARC可以在每个文件的基础上使用,但我理解您的问题,第三方代码可以保留一个。 – zaph 2012-04-09 13:24:04