Declaring a property atomic makes compiler generate additional code that prevents concurrent access to the property. This additional code locks a semaphore, then gets or sets the property, and then unlock the semaphore. Compared to setting or getting a primitive value or a pointer, locking and unlocking a semaphore is expensive (although it is usually negligible if you consider the overall flow of your app).

WELCOME TO iOSLINKER

SUSCRIBE TO NEWSLETTER

FOLLOW ME

I am Jitendra Gochhayat, an iOS developer,blogger, from Odisha,India.I write about Objective C tutorials,iOS interview Questions And Answers,swift tutorials and cocos2d-x sample codes to help the developers.