Dear all,
In my continuous struggle to learn how to code I am starting to see some light as, without help, I can complete the lessons and the apps work!
Just now I would like to complete the challenge at the end of Unit 4.9 of 'App Development with Swift'.
The app by itself (a room booking app) works as follows:
- TableView(1) > click '+' > get into another TableView(2) > insert a bunch of data (names, dates, ... ) > click 'Done' button
- TableView(1) now has a row carefully populated with the data I have inserted in TableView(2).
Now, the challenge asks that I create a segue from TableView(1)'s cell that would allow the user to get back to TableView(2) and see the datas (and I assume possibly edit them).
I had no problem creating a functioning segue but I get to an empty TableView(2), instead of to the one I just used.
I wonder if this has something to do with data not being saved but I doubt it because every new entry gets appended into an array.
I can paste hundreds of lines of code but I would prefer to get a hint to the logic needed to get back to my 'detailTableView'.
Is it the reloadView() method?
Thank you for your help and feel free to ask me any other detail I could add to help you help me!
I will keep crunching my brain as I feel something improving!
Thanks!
The key problem was that the prepare did not set the properties of the destination controller.
You should also simplify the design: you have set a tableView to display a reservation, with 5 sections and several rows in each section, each with a different cell type which contain a single instance !
That's is not a the best use of table views.
You should better replace this tableView by a simple ViewController, where you would put all the itmes.
I'll send an example of this separately.
Good luck.