私のアプリケーションでは、NSMutableArrayでSQLクエリの結果を直接返す1つのライブラリを使用しています。インストルメントを使用すると、結果が格納されている配列のメモリリークが表示されます。したがって、ライブラリの作成者はinit-を処理していません。配列を適切にリリースします。コード内のライブラリの外部でその配列によって引き起こされたメモリリークを処理する方法はありますか?コードは次のとおりです。
-(void)getRecurringDataFromDatabase
{
SafeRelease(_arrTblList);
_arrTblList=[[NSMutableArray alloc]init] ;
NSError *error = nil;
NSString *strQuery = [NSString stringWithFormat:@"select * from wt_transaction as w where w.subcat_id in (select s.subcat_id from subcategory as s where s.subcat_type = 'expense' and IsRepeat = 1)"];
NSMutableArray *arrExpense = [NSMutableArray requestWithSynchronousQuery:strQuery withReturnningError:&error] ;
NSString *strQuery1 = [NSString stringWithFormat:@"select * from wt_transaction as w where w.subcat_id in (select s.subcat_id from subcategory as s where s.subcat_type = 'income' and IsRepeat = 1)"];
NSMutableArray *arrIncome = [NSMutableArray requestWithSynchronousQuery:strQuery1 withReturnningError:&error];
if (error) {
[AppDelegate showAlert:[error description] withTitle:@"Error!"];
}
else{
if ([arrExpense count]>0)
{
[_arrTblList addObject:arrExpense];
}
if ([arrIncome count]>0)
{
[_arrTblList addObject:arrIncome];
}
_reloadCell = YES;
[_tblView reloadData];
}
ここでは、arrIncomeとarrExpenseのメモリリークが示されています。これらのアレイを解放または自動リリースしても、メモリリークは解決されません。これらのリークを解決する唯一の方法は、ライブラリの作成者が解決できるかどうかです。また、もしも
(indexPath.row == 0) {
OverviewViewController *obj1 = [[OverviewViewController alloc] initWithNibName:@"OverviewView" bundle:nil];
[self.navigationController pushViewController:obj1 animated:YES];
[obj1 release];
} this code at line [self.navigationController pushViewController:obj1 animated:YES];
.how to resolve this leak?