I have a Struct:
struct Note{
var date: String;
var comment: String;
}
Then I create a an array with two arrays nested within,
var data = [[Note()],[Contributors()]]
These two arrays are used to populate two sections of a Table View. I need to append a struct onto the Notes struct array but when I try and append it using
data[0].append(Note(date: "06-06-2012",comment:"Created Note"))
and
(data[0] as! Note).append(Note(date: "06-06-2012",comment:"Created Note"))
throws the error
Cannot use mutating member on immutable value of type 'Note'
How you can mutate values that need to be casted?
NoteANDContributors(based on my testing) -data.append([Note(data: "06-06-2012",comment:"Created Note"), [Contributors()]]or something like that