This is the field of Swift game; I want to assemble the examples of my 'work' class in an array so that the properties of each job can be used in a tableview. I am searching for documentation, but I do not see the discussion about getting started and reaching my classes properly in an array.
last line of code gives an error that any object member reads deadline named This is what I use the Swift Arre, or empty NSMutableArray of objects I am I tried different ways of it being molded as a whole, but it'm emphasizes this error is going to reach me to store the wrong way about it and then the data? I'm a javascript brand, sometimes the parallelism of the syntax takes me to confuse.
import UIKit to todays_date = NSDate () // Now let calories = NSCalendar.currentCalendar () DAY_NUMBER go = cal.ordinalityOfUnit (.CalendarUnitDay, inUnit: .CalendarUnitYear, forDate: todays_date) God works = [] NSMutableArray class as Task {var title: string var interval: Int bridesmaid dateActivated: Int bridesmaid deadline: Int bridesmaid flag_count: Int = 0 var isActivated: bool = false init (title: string, dateActivated: Int, Interval: int) {// New self.title = title self.dateActivated = dateActivated self.interval = Interval // calculate self.deadline = dateActivated + Start by selecting the interval}} on task1 = Task (Shear Usage: "wash", dateActivated: DAY_NUMBER, interval: 7) on task2 = task (title: "dishes", dateActivated: DAY_NUMBER, interval: 7) task1.deadline task2.flag_count tasks.addObject (function1) work bject (Task2) [0] .deadline // AnyObject member is not a designated deadline
No need to use foundation arrays, just declare your code as [Task]
( Task
after declaring the class):
on functions = [Task] ()
instead of
then Using addObject
:
Tasks.append (task1) tasks.append (task2) function [0] .deadline // 83
No comments:
Post a Comment