AppDelegate.h
--------------------
PLSqliteDatabase *db;
@property (nonatomic, retain) PLSqliteDatabase *db;
AppDelegate.m
---------------------
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// open database and init data manager
NSString *pathToDb = [DBUtil pathToDb];
self.db = [[PLSqliteDatabase alloc] initWithPath:pathToDb];
[self.db open];
self.dm = [[DataManager alloc] initWithDatabase:db];
In DataManager through which I do all db access
DataManager.h
---------------------
@private
PLSqliteDatabase *dbase;
}
@property(nonatomic, retain) PLSqliteDatabase *dbase;
- (id)initWithDatabase:(PLSqliteDatabase *)database;
DataManager.m
----------------------
@synthesize dbase;
- (id)initWithDatabase:(PLSqliteDatabase *)database {
if (self = [super init]) {
self.dbase = database;
if (![dbase goodConnection]) {
NSLog(@"Could not connect to database");
return nil;
}
[self initSQLStatementsAndColumns];
}
return self;
}
The database is retained by both AppDelegate and DataManager.
I'm able to establish the connnection to the db. Error occurs on first
prepare statement in DataManager,
Landon - Thanks for looking into this.
> PGP.sig
> < 1KViewDownload