このコードのどこでメモリリークが発生しているのかを突き止めようとしていますか?
- (NSMutableArray *) fetchAidDetails:(NSNumber *) rowID {
NSMutableArray *list = [[NSMutableArray alloc] init];
FMDatabase *db = [[FMDatabase databaseWithPath:[self dbPath]] retain];
if(![db open]) {
[db release];
return [list autorelease];
}
NSString *query = [NSString stringWithFormat:@"select legislative_type, legislative_name from legislative_aid where official_id = %d", rowID.unsignedIntValue];
FMResultSet *result = [[db executeQueryWithFormat:query] retain];
while ([result next]) {
NSMutableDictionary *item = [[NSMutableDictionary alloc] init];
NSString *type = [[NSString alloc] init];
type = [result stringForColumn:@"legislative_type"];
[item setObject:type forKey:@"legislative_type"];
[type release];
NSString *party = [[NSString alloc] init];
party = [result stringForColumn:@"legislative_name"];
[item setObject:party forKey:@"legislative_name"];
[party release];
[list addObject:item];
[item release];
}
[result release];
[db close];
[db release];
return [list autorelease];
}
[アイテムの保持カウント] は [アイテムの解放] の前に 2 を与え、[リストの自動リリース] は参照カウントを 0 にします。ここで何か問題がありますか?
助けてください。
ありがとうございました