libsqlite3.dylib本身是个链接,在这里它指向libsqlite3.0.dylib。也就是说在这里你添加libsqlite3.dylib和添加libsqlite3.0.dylib其实是添加了同一个文件,没有区别,那为什么要添加libsqlite3.dylib呢?原因在于libsqlite3.dylib总是指向最新的sqlite3动态库,也就是说如果出现了新的动态库(如:libsqlite3.1.dylib)那libsqlite3.dylib将指向这个新的动态库(libsqlite3.1.dylib)而不在是libsqlite3.0.dylib了!所以建议还是要添加libsqlite3.dylib。
注:
On Mac OS X,frameworks are just libraries,packed into a bundle. Within the bundle you will find an actual dynamic library (libWhatever.dylib). The difference between a bare library and the framework on Mac is that a framework can contain multiple different versions of the library. It can contain extra resources (images,localized strings,XML data files,UI objects,etc.) and unless the framework is released to public,it usually contains the necessary .h files you need to use the library.
A library is just that,"a library". It is a collection of objects/functions/methods (depending on your language) and your application "links" against it and thus can use the objects/functions/methods. It is basically a file containing re-usable code that can usually be shared among multiple applications (you don't have to write the same code over and over again).
原型:
用这个函数开始数据库操作。需要传入两个参数,一是数据库文件名,比如:比如:E:/test.db. 在ios中可能是:
- NSArray*documentPath=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
- NSString*dbPath=[[documentPathobjectAtIndex:0]stringByAppendingPathComponent:@“test.db”];