0

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..."
}];
jonalmeida
  • 1,206
  • 1
  • 9
  • 24

1 Answers1

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.

ccgus
  • 2,906
  • 23
  • 18
  • No, it isn't recursive. I'm making one inDatabase: call but inside that block, I'm calling myMethod which calls executeUpdate. This is different from the docs that say I should have the executeUpdate straight inside of the inDatabase: block. Would that still work? – jonalmeida Jul 13 '14 at 04:29
  • You know what, I think I just realized that this may have been a silly question (and one that I shouldn't have thought about asking at 2am..) Thanks! – jonalmeida Jul 13 '14 at 06:16