Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
What does nonatomic and retain do in Objective-C?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="xstep" data-source="post: 1293031" data-attributes="member: 11647"><p>Both are discussed here in <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocProperties.html" target="_blank">The Objective-C Programming Language</a>. Search that document for those two words.</p><p></p><p>In short...</p><p></p><p>The nonatomic directive means no locking of the variable is done during access. This speeds up access. In a multithreading scenario that could be a bad thing.</p><p></p><p>The retain directive means that upon assignment, the object will be retained. If you override the properties setter method, I believe you are then responsible for the retain.</p></blockquote><p></p>
[QUOTE="xstep, post: 1293031, member: 11647"] Both are discussed here in [URL="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocProperties.html"]The Objective-C Programming Language[/URL]. Search that document for those two words. In short... The nonatomic directive means no locking of the variable is done during access. This speeds up access. In a multithreading scenario that could be a bad thing. The retain directive means that upon assignment, the object will be retained. If you override the properties setter method, I believe you are then responsible for the retain. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
What does nonatomic and retain do in Objective-C?
Top