1.

Can you explain the difference between atomic and nonatomic properties? What is the default for synthesized properties?

Answer»

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.



Discussion

No Comment Found