标签: swift
I was working with the code in the following picture then i got a message says:use of undeclared type 'Grade' var grades: [Grade] = [] 那我该怎么办?
答案 0 :(得分:-1)
似乎没有声明Grade。在创建具有该类型的数组之前,您必须这样做。例如,将以下代码添加到您的文件中。
Grade
class Grade { var grade: Int var name: String init(grade: Int, name: String){ self.grade = grade self.name = name } }