Why checkList when hide checkmark when row0check = false

row0check = false

if indexPath.row == 0 {
row0checked = !row0checked
if row0checked {
cell.accessoryType = .checkmark
} else {
cell.accessoryType = .none


Here my code.
When i run app, checkmark’s state is checked. and init state of row0checked = false.
and when i tap screen, row0checked will = true, that lead cell.accessoryType = checkmark.(checkmark will appear)
But the checkmark on my iPhone is hide.
Please explain why row0check = true lead checkmark is hide.

It’s a little difficult to know what is going on in your code without more context :slight_smile: You have provided a code snippet but there is no indication as to where the code snippet is used, how it is used etc.

You can compare your code to the final project provided for the chapter to see what the difference might be. If you can’t find the issue by comparing your code to the final project, please create a ZIP file of your project, upload it somewhere and then provide a link so that anybody interested can run the project and see what is going on.

This topic was automatically closed after 166 days. New replies are no longer allowed.