Следующие методы вызываются из didFinishLaunchingWithOptions, когда я запускаю на инструментах openDatabase метод, вызывающий утечки .., пожалуйста, предложите мне, как очистить
- (NSString*)getdestinationPath {
NSArray *pathsArray=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *doumentDirectoryPath=[pathsArray objectAtIndex:0];
NSString *destinationPath=[doumentDirectoryPath stringByAppendingPathComponent:dataBaseName];
NSLog(@"database path %@",destinationPath);
return destinationPath;
}
- (void)chkAndCreateDatbase {
NSFileManager *fileManger=[NSFileManager defaultManager];
NSError *error;
NSString *destinationPath=[self getdestinationPath];
if ([fileManger fileExistsAtPath:destinationPath]){
//NSLog(@"database localtion %@",destinationPath);
return;
}
NSString *sourcePath=[[[NSBundle mainBundle] resourcePath]stringByAppendingPathComponent:dataBaseName];
[fileManger copyItemAtPath:sourcePath toPath:destinationPath error:&error];
}
- (void)openDatabase {
path=[self getdestinationPath];
if (sqlite3_open([path UTF8String], &database)==SQLITE_OK) // here leak is showing
{
NSLog(@"dataBaseOpen");
}
else {
sqlite3_close(database);
NSLog(@"dataBaseNotOpen");
}
}