Alex Rivera | Logout

@property retain, assign, copy, nonatomic in Objective-C

Asked 2010-02-12T23:51:26.393
231

As someone that's new to Objective-C can someone give me an overview of the retain, assign, copy and any others I'm missing, that follow the @property directive? What are they doing and why would I want to use one over another?

Edit
Report

1 Answer

11

Atomic property can be accessed by only one thread at a time. It is thread safe. Default is atomic .Please note that there is no keyword atomic

Nonatomic means multiple thread can access the item .It is thread unsafe

So one should be very careful while using atomic .As it affect the performance of your code

answered 2013-01-29T03:29:20.433

Your Answer