This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5995-beginning-table-views/lessons/19
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5995-beginning-table-views/lessons/19
Hi, I finished this video, tried the app, but the app still does not saves its check/unchecked state of the rows.
Is that right?
Is it purposely done like this ?
Also, I guess after the Bulleye app it is a huge step. Very difficult to follow. I preferred Rays way to teach. It is a lot going on very difficult… Could have been another app between the two. I dont know…
Yes - the app currently does not save the state. This means, if you shut down the app, you’ll lose all your data. In an upcoming course, you’ll learn how to save your app state.
As for the complexity - yes - the course covers a lot. We’ll be reevaluating in the coming months. That said, I appreciate the feedback. Thanks!
Dear Brian,
thank you for your tutorial.
I would like to really understand why the app is not configuring the checkmark without the item.toggleChecked() line.
After all, in theory, the basic of the item is that checked is false so, once I click, it should just update the checkmark and, yes, then I could update also the item. But why it is not so?
Thank you so much!
I’m not sure what you are encountering. Feel free to paste your code and I can diagnose the issue for you. Thanks!
I guess now everything is working more or less fine!
Thank you for keeping up with me!
Hey!
You changed almost a half of the code in this lesson.
Seems like what we watched before is useless and we need to make everything like you did in this last video…
@ollybess It’s all part of the process of refactoring your code along the way! :]
Hey!
Tutorial is awesome I just have one question about the logic.
Because now if I’m looking correctly configureCheckmark will be called automatically while dequeuing the cells and mark all of them as checked.
Also, the if in configure kinda isn’t too readable if is checked then set it to none?
Wouldn’t be rather more readable to change the configureCheckmark to just represent the state so set the accessoryType to corresponding model value and change the state in the didSelectRowAt?
If I would like to call somewhere else the configureCheckmark method I think I won’t be always willing to change its state.
Cheers!
@bdmoakley Can you please help with this when you get a chance? Thank you - much appreciated! :]
I agree. I did this. I had a version of configureCheckmark to be called during the cellforrowat - all this did was to set the checkmark based on the checked property of the model. But I had to initialise the todolist checklistitems to all be ‘true’ for this to work.
Then I had another version of configureCheckmark to be called during didselectrowat which toggled the model and then set the checkmark based on the newly set checked property of the model.
Doing this got rid of the bug where you drag down the tableview which ended up changing the checkmarks because it was firing the original configureCheckmark which was updating the model and toggling the checkmark.
@hashmo Thank you for sharing your solution - much appreciated! :]