Ios what does nonatomic mean

What does the property "Nonatomic" mean?

Take a look at the Apple Docs .

Basically, if you say nonatomic. and you generate the accessors using @synthesize. then if multiple threads try to change/read the property at once, badness can happen. You can get partially-written values or over-released/retained objects, which can easily lead to crashes. (This is potentially a lot faster than an atomic accessor, though.)

Ios what does nonatomic mean

If you use the default (which is atomic ; there used to be no keyword for this, but there is now ), then the @synthesize d methods use an object-level lock to ensure that multiple reads/writes to a single property are serialized. As the Apple docs point out, this doesn't mean the whole object is thread-safe. but the individual property reads/writes are.

Of course, if you implement your own accessors rather than using @synthesize. I think these declarations do nothing except express your intent as to whether the property is implemented in a threadsafe manner.

Related posts

  • I almost lasted the week using only my iPad, but one thing held me back “When my trusty 12-inch MacBook went in for repair last Saturday, I decided to try a week using just an iPad Air as my...

  • How much is 1GB, and what does it mean? What's in a byte Karma has a simple business model: we sell mobile data at a small profit. Instead of making mobile data into an amorphous service with...

  • BB Curve. How To Get Edge In Uppercase Letters Nov 19, 2011 In the top right hand corner of my Blackberry it says edge (lowercase) how do I get it to say EDGE (caps)? And do I need EDGE to be...

  • Princeton's WordNet (0.00 / 0 votes) Rate this definition: cell phone (verb) call up by using a cellular phone "If the train is late, I will cell phone you" Wiktionary (0.00 / 0 votes) Rate...

  • What does a soft reset do to an iPhone 4 A soft, or even a hard, reset does not reset your iPhone 3G to factory settings. That is called restoring your iPhone. A soft reset keeps all of your...