Skip to content

Instantly share code, notes, and snippets.

@leohacker
Last active August 29, 2015 14:14
Show Gist options
  • Save leohacker/07b7cb0e546401bafbca to your computer and use it in GitHub Desktop.
Save leohacker/07b7cb0e546401bafbca to your computer and use it in GitHub Desktop.
Find the path for resource, open the sqlite3 database.
- (id)init {
if ((self = [super init])) {
NSString *sqLiteDb = [[NSBundle mainBundle] pathForResource:@"banklist"
ofType:@"sqlite3"];
if (sqlite3_open([sqLiteDb UTF8String], &_database) != SQLITE_OK) {
NSLog(@"Failed to open database!");
}
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment