This code gives me an error; Type 'task.Type' has no subscript members
This is my code:
struct task {
var name = "Un-Named"
var desc = "Un-Described"
}
class TaskManager: NSObject {
var tasks = task[]()
func addTask(name: String, desc: String){
tasks.append(task(name: name, desc: desc))
}
}
Aucun commentaire:
Enregistrer un commentaire