Swift accessing class variable inside closures
问题 Why in Objective-C I can set instance variable inside a block: @interface CMVServices : UIViewController @property (nonatomic, strong) NSMutableArray *times; @implementation CMVServices @synthesize times=_times; and set the _times instance variable inside a block: (some code ) . . [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { [_times addObjectsFromArray:objects]; } but I can't in Swift? class ViewController: UIViewController var times :AnyObject[]! query