У меня есть массив экземпляров класса словарей, описанный ниже:
class SomeViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
private var array = [[String: AnyObject]]()
override func viewDidLoad() {
super.viewDidLoad()
}
// tableview delegates
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
print(“array address: \(unsafeAddressOf(array))”) // 0x000000015cf0ebd0
let option = UITableViewRowAction(style: .Default, title: “Option”, handler: { [weak self] (_, _) in
guard let strongSelf = self else { return }
print(“array address1: \(unsafeAddressOf(strongSelf.array))” // 0x000000015cd10c50
})
return [option]
}
}
почему адрес array
изменен (0x000000015cf0ebd0
против 0x000000015cd10c50
), поскольку я просто фиксирую его при инициализации UITableViewRowAction
?
Спасибо,