ios - Passing in ivar into method Swift -
i making simple reminder app in swift , i'm having hard time figuring out why can't method compile.
reminder in self.reminders { if dates.contains(dateformatter.stringfromdate(reminder.date)) { dates.add(reminderdate) } }
on call stringfromdate
getting error saying
"cannot invoke "stringfromdate" argument list of type (nsdate?!)"
the date
ivar nsdate, need able call it?
i declare property var date: nsdate
declaration property var reminders = []
class trreminder { enum trpriority { case low, medium, high } var title: string var date: nsdate var location: string var priority: trpriority var note: string init(title: string, date: nsdate, location: string, priority: trpriority, note: string) { self.title = title self.date = date self.location = location self.priority = priority self.note = note } }
do this
var reminders = [trreminder]()
declaring []
is, believe, equivalent [anyobject?]
Comments
Post a Comment