У меня есть утечка памяти, когда я вызываю следующий метод
- (NSArray *) children
{
NSArray *children = [node objectForKey:TFHppleNodeChildrenKey];
NSMutableArray *hpple = [NSMutableArray arrayWithCapacity:[children count]];
for(NSDictionary *child in children) {
[hpple addObject:[[TFHppleElement alloc] initWithNode:child]];
[child release];
}
return hpple;
}
Я получаю утечку памяти на TFHppleElement
, я выделяю это, но я не уверен в лучшем способе освободить его в этом контексте?TFHppleElement
initWithNode
выглядит так:
- (id) initWithNode:(NSDictionary *) theNode
{
if (!(self = [super init]))
return nil;
[theNode retain];
node = theNode;
return self;
}