Swift 2 makeFunctionNamed not working

61 views
Skip to first unread message

alis...@codebrane.com

unread,
Aug 31, 2016, 2:24:11 PM8/31/16
to FMDB
I used FMDB in a previous project via CocoaPods and all was working fine. However in the latest version I copied the .h and .m files into my project rather than use pods (too slow) and can use FMDB ok. The trouble starts when using makeFunctionNamed as the #import "sqlite3.h" is now in FMDatabase.m instead of FMDatabase.h so for instance sqlite3_result_null can't be found. If I add sqlite3 to my bridging header I get a segfault when compiling - "cannot convert value of type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>') to expected argument type 'COpaquePointer'".

database.makeFunctionNamed("distance", maximumArguments: 4) { context, argc, argv in
      if argc != 4 {
        sqlite3_result_null(context) -> segfault as above, worked when using previous version of FMDB
      }
}

Is there a way to use native sqlite3 alongside FMDB as before? Was FMDB doing something different previously that let me use native sqlite3 functions alongside FMDB code?

thanks,

Alistair

Reply all
Reply to author
Forward
0 new messages