Creating an SQLite3 database file through Objective-C

后端 未结 6 1638
攒了一身酷
攒了一身酷 2020-12-01 15:19

I\'m trying to create an SQLite3 database file through Objective-C at run time. I am trying to create a table called \"tblStore\". I want the field names to be called \"st

6条回答
  •  不知归路
    2020-12-01 15:52

    Is there a specific reason you'd like to use SQLLite directly, as opposed to using CoreData? CoreData uses an SQLLite database but is itself a higher-level API, and particularly with table views and such, you get a lot of functionality and template methods that are already set up for it in Xcode. Defining data models is trivial, you get tons of boilerplate code, and it's all optimized.

    http://www.raywenderlich.com/934/core-data-on-ios-5-tutorial-getting-started

    CoreData is sometimes described as having a steep learning curve. I disagree. If you're considering writing SQL yourself in your app, you're not going to have any trouble with CoreData.

    The term "sandbox" is an abstract term for the portion of the device's filesystem that your application has read/write access to. The "Documents" directory is a specific directory within your application's sandbox. There are other files in your sandbox than just the documents directory, but most applications that save data to the filesystem in iOS do so in the documents directory.

提交回复
热议问题