I am using CoreData for my project and I came into this error:
Error: Value of type 'String' has no member 'totalAnswered'
if let date = score.datePlayed, let score = score.totalScore, let questions = score.totalAnswered {
cell.textLabel?.text = "Date: \(date)\nScore: \(score)/\(questions)"
Look at the 2nd let
. You create a new variable named score
that hides the original variable named score
. So the 3rd let
is trying to access the wrong score
.
The best solution is to use a different variable name on the 2nd let
.