iOS SQLite Database - IOS

What is iOS - SQLite Database?

SQLite is used in iOS for handling the data. It uses sqlite queries, which makes it ease to work for those who are aware of SQL.

Steps Involved

  • Step 1. Let us create a simple View based application.
  • Step 2. We need to select our project file, then select targets and then add libsqlite3.dylib library in choose frameworks.
  • Step 3. We need to create a new file by selecting File-> New -> File... -> select Objective C class and click next.
  • Step 4. We need to name the class as DBManager with "sub class of" as NSObject.
  • Step 5. Select create.
  • Step 6. Update DBManager.h as displayed below−

Step 7. Update DBManager.m as follows −

  • Step 8. We need to update ViewController.xib file as below −

iOS - SQLite Database

  • Step 9. Create IBOutlets for the above text fields.
  • Step 10.We need tocreate IBAction for the above buttons.
  • Step 11. We need toupdate ViewController.h as below−

  • Step 12. We need to update ViewController.m as follows −


On running the application, we will get the below screenshot as output where we can add and find the student details −

iOS - SQLite Database

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

IOS Topics