I have some weird memory issues in an app and I'm wondering if I'm doing the correct thing here. I use Realm and have e.g:
try! self.realm.write {
self.realm.add(newItem)
}
But I'm wondering if I'm causing a retain cycle inadvertently so should maybe do:
try! self.realm.write { [unowned self] in
self.realm.add(newItem)
}
Which would be correct and why?