我使用 SQLCipher 在我的应用程序中加密 sqlite 数据库。一切正常,但我的应用程序在获取数据库期间运行缓慢。我将PRAGMA kdf_iter更改为 4000,但它仍然很慢。加密之前我没有任何问题。
-(NSError *) openDatabase {
NSError *error = nil;
NSString *databasePath = [self getDatabasePath];
const char *dbpath = [databasePath UTF8String];
int result = sqlite3_open_v2 (dbpath, &db , SQLITE_OPEN_READWRITE , NULL);
if (result == SQLITE_OK) {
sqlite3_exec(db, [@"PRAGMA kdf_iter = '4000';" UTF8String], NULL, NULL, NULL);
sqlite3_exec(db, [@"PRAGMA key = 'password'" UTF8String], NULL, NULL, NULL);
NSLog(@"Password is correct , Database is Activated");
sqlite3_exec(db, [@"PRAGMA cipher = 'aes-256-cfb';" UTF8String], NULL, NULL, NULL);
}
else { …Run Code Online (Sandbox Code Playgroud) 场景套件中名为“name.Shader”和“name.vsh”和“name.fsh”的文件有什么区别?当我在项目中调用一些着色器时,我的模型就像一个紫色蒙版。我应该怎么办?
我是RXSwift的新手,我定义了一个Observable interval定时器序列,该序列每秒调用一次Webservice方法。在该Web服务响应中,我收到新的重试时间值,该值必须替换为当前时间。如何用新的时间值重置此序列?这是我的代码:
func mySequence() {
/////////////////////////////////////// subscribe to Timer (time change)
var time = try! self.timer.value()
self.disposeTimer = timer.subscribe({ value in
time = value.element!
print("=============================\(String(describing: time))=======================================")
})
/////////////////////////////////////// subscribe to Timer (time change)
let observable = Observable<Int>.interval(TIME I NEED TO CHANGE After response , scheduler: MainScheduler.instance).map { _ in ()
self.myWebserviceMethod()
}
disposable = observable.subscribe(onNext: {num in
}, onError: { err in
}, onCompleted: {
}, onDisposed: {
})
}
Run Code Online (Sandbox Code Playgroud)
一切都会发生,但是间隔计时器时间仍然是旧值:(