UX Designer Question: Download UX Designer PDF

Tell me the difference between atomic and nonatomic synthesized properties?

Tweet Share WhatsApp

Answer:

Atomic and non-atomic refers to whether the setters/getters for a property will atomically read and write values to the property. When the atomic keyword is used on a property, any access to it will be “synchronized”. Therefore a call to the getter will be guaranteed to return a valid value, however this does come with a small performance penalty. Hence in some situations nonatomic is used to provide faster access to a property, but there is a chance of a race condition causing the property to be nil under rare circumstances (when a value is being set from another thread and the old value was released from memory but the new value hasn’t yet been fully assigned to the location in memory for the property).

Download UX Designer PDF Read All 67 UX Designer Questions
Previous QuestionNext Question
Tell us how should one properly design push notifications? Why are they so important?Tell us what's the difference between using a delegate and notification?