简体   繁体   中英

Xcode Retrieving data from SQLite database to a tableview controller

We are trying to make an iOS application with objective c where the owner of a wedding hall can submit his hall information and the admin has the right to accept the submission of the hall or deny it. When the admin accepts it it'll go directly into the hall table in the SQLite db that we created. The thing we are trying to do now is viewing the infromation of the accepted hall from the hall table in our db in a table view where every accepted hall gets added in that table view. We can't seem to find any tutorial to help us with this. So my question is what do I do in the .h and .m files of the tableview to help me retrieve the information?

First thing if you are using tableView then it's don't have it's own .h or .m file. It is added as subview in any ViewController . which have .h and .m file.

If you use tableViewController then it have it's .h and .m file will be there.

Second thing, you have to used tableview delegate and datasource method to show your data.

If you dont have much idea then first learn basic of tableview.

Now comes to the sqlite,

You can get your data in NSArray by using proper sqlite query and that array can use to fill data in tableView Datasource.

Here i am sharing some links for sqlite great tutorial,

Appcoda

Techotopia

TutorialsPoint

and Raywenderlich is also good as mentioned in another answer.

Hope this will help you. ;)

You can fire a query to the sqlite database and fetch the details for all accepted halls.

Refer Reading the SQLite Data and Creating a Table View Sections in https://www.raywenderlich.com/913/sqlite-tutorial-for-ios-making-our-app .

This might be helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM