Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialGuled A.
10,605 Points@Property Method: What is 'nonatomic' and 'strong'?
The course for objective-c was very nice, but I did not quite understand what these two parameters in the @property method meant. Could anyone elaborate?
Thank you in advance.
2 Answers
jschlansky
7,229 PointsThe 'nonatomic' property is the opposite of the default 'atomic' property. A variable with the 'nonatomic' property means that the variable is not thread safe. This might sound scary, but it just means that the variable can be accessed from multiple threads at the same time. The 'atomic' property does not allow this, which makes the 'nonatomic' property faster to use.
The 'strong' property replaced the 'retain' property. The 'strong' property is required when the attribute is a pointer to an object, and it will be retained in memory. The opposite of this is the 'weak' property.
Stone Preston
42,016 PointsThis page helped explain ARC stuff pretty well for me. It can be kind of hard to understand
Guled A.
10,605 PointsThank you for the article. It helped a lot.
Guled A.
10,605 PointsGuled A.
10,605 PointsVery good explanation. I understand those concepts now. Thank you for your help.