Learn Courses My Dashboard

Retrieve display and update multiple attribute in database

Link: Core Data Tutorial - Lesson 3: CRUD - Create, Retrieve, Update, and Delete - YouTube

Chris goes through step by step on how to create, retrieve, update and delete data from database, he only does this whith one attribute or column of a database, but i want to be able to update multiple attributes.

I already created user input, that stores their input into the database. What i want is to do display the databse in a tableview where the table view cell display an entire record, and when pressing or taping on it, alert appears with a user form inside it that has the record’s details already filled out, but user can change and update the existing record or row.

I seen video of when updating, the user has to type the id to reference the database and fill out all the details again to update, what i desire is to click on a table view cell where the the data can be retieved and shown in the inputs, and can change and update. Exactly as chris done.

I will appreciate if someone can recommended a guide video or website where i can achieve this.

Thank you to whomever answers

I edited your first post, to add the link.

First have you created the tableView and implemented the didSelectRowAt function?
You’ll do something similar that he does in this video, but instead of only using person.name you’ll use all the properties (all the columns) of your model.

Like on line 127 at 18:55 in the tutorial you linked

What’s your model look like?

Hi,

Thank you so much, was able to update multiple columns.

So what i am doing is creating an app for a user to enter grocery and list it in table, so the name and quatity, then another input page to input the location that grocery would come from, then combine store and the grocery from that store into one record hopefully. Right now, just focus on grocery.

Another question, how do i display multiple columns, so chris in the video, displays only one, but want to display the entire record, so the name and quantity of the grocery

Appreciate the response

Again, Thanks

You’ll access the different properties in your model.

Can you show more about what your model looks like?

You can use an array of the entire model, and access the proper properties for different labels