I'm guessing the answer is no, but I'm having a difficult time finding a straight answer. For example:
func doSomething() {
let thing = Things.sharedInstance.list[0]
if let maybeProperty = thing.property { // Program Crashes EXC bad memory access error
// Do something with property
}
}
Is list as a class property the only strong reference, while thing inside a function (in a class) does not hold a strong reference / increment the reference count? Therefore, in a race condition between the assignment and the optional unwrapping variable assignment, the underlying thing can be deallocated?
Thanks! :)