Google News
logo
IOS - Interview Questions
Can you explain the difference between atomic and nonatomic properties? What is the default for synthesized properties?
Atomic Property : It is the default property and ensures a valid value will be returned from the getter or set by the setter. This ensures that only one thread can access the getter/setter of a given property at a time and that all other threads must wait until the first thread releases the getter/setter. Despite being thread-safe, it is not fast, since it ensures that the process is completely completed.
 
Non-Atomic Property : With non-atomic properties, multiple threads can access the getter/setter method of a given property at the same time, so the potential for inconsistency between values exists. They come with enhanced access, but no guarantee of the return value.
Advertisement