let name = file.name
withUnsafePointer(to: &file) {
print ("GETDEPOSIT: \(name) \(file.nameSuffix) file has address: \($0)")
}
I would really appreciate if anyone can tell me where there is modification and why this new piece of shit technology requires such a weird dance just to print a variable address. I already spent an hour trying to figure this out.
class BVFile { ... }
class OperationCell: UICollectionViewCell {
var file: BVFile!
}
UPD Thanks Martin R and Sweeper. Sweeper's answer fixes the crash indeed but the addresses do differ:
GETDEPOSIT: Сберегательный вкл@д 166,63 BYN Optional(" 166,63 BYN") file has address: 0x00007fd8fc555578 0x0000600003194840
GETDEPOSIT: Зручны анл@йн 0 BYN Optional(" 0 BYN") file has address: 0x00007fd8fc55e138 0x00006000031ea040
that was produced by this
let address = Unmanaged.passUnretained(file).toOpaque()
withUnsafePointer(to: &file) {
print ("GETDEPOSIT: \(name) \($0.pointee?.nameSuffix) file has address: \($0) \(address)")
}