- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Set up the window with loginViewController as the rootViewController for now // to avoid showing app view on launch on iOS 8 [[self window] setRootViewController:self.loginViewController]; [[self window] makeKeyAndVisible]; self.isLoginViewControllerDisplayed = YES; // Set up a SQLCipher database connection: sqlite3 *db; if (sqlite3_open([[self.databaseURL path] UTF8String], &db) == SQLITE_OK) { const char* key = [@"StrongPassword" UTF8String]; sqlite3_key(db, key, (int)strlen(key)); if (sqlite3_exec(db, (const char*) "SELECT count(*) FROM sqlite_master;", NULL, NULL, NULL) == SQLITE_OK) { NSLog(@"Password is correct, or a new database has been initialized"); } else { NSLog(@"Incorrect password!"); } sqlite3_close(db); } return YES; }