FMDB: Does calling a method to make a query in the inDatabase block work the same way?

空扰寡人 提交于 2019-12-11 16:19:58

问题


I'm trying to remove some database records, and I have a wrapper class around my FMDB class. What I'm wondering, is if I can call this class method from the inDatabase block?

[_dbQueue inDatabase:^(FMDatabase *db) {
    // Do some magic here to get 1234
    [myObject deleteWithId:1234]; // This calls executeUpdate:@"DELETE..."
}];

回答1:


If you're using the latest FMDB, it should crash on you (if your other method is using inDatabase: as well). Recursive inDatabase: calls aren't advised.



来源:https://stackoverflow.com/questions/24719471/fmdb-does-calling-a-method-to-make-a-query-in-the-indatabase-block-work-the-sam

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!