In Objective-C, you have a distinction between atomic and non-atomic properties:
@property (nonatomic, strong) NSObject *nonatomicObject; @property (atomic, strong) NSObject *atomicObject;
From my understanding, you can safely read and write properties that are defined as atomic from multiple threads, while writing and accessing non-atomic properties or ivars from multiple threads can result in undefined behavior, including bad access errors.
So, if you have a variable like Swift:
var object: NSObject
Is it safe to read and write this variable in parallel? (Excluding the actual value of this).
objective-c swift
lassej Jun 11 '14 at 8:14 2014-06-11 08:14
source share