Even though I can’t count how many times I’ve used properties, I thought I would make a cheatsheet to cover the basic definitions. This article was the best one I could find to adequately explain all the concepts.
Syntactical shortcut for declaring a class’s accessor (setter and getter) methods using a similarly named instance variable.
An instance method that gets or sets the value of a property of an object.
Method that retrieves the value of an object’s property.
Method that changes the value of an object’s property.
Allows you to create a backing variable and override accessor methods. This is optional for Xcode 4.4+. This is mandatory if you override setters/getters.
Use a custom name for the getter method.
Use a custom name for the setter method.
Don’t synthesize a setter method.
Don’t guarantee the integrity of accessors in a multi-threaded environment. This is more efficient than the default atomic behavior.
Create an owning relationship between the property and the assigned value. This is the default for object properties.
Create a non-owning relationship between the property and the assigned value. Use this to prevent retain cycles.
Create a copy of the assigned value instead of referencing the existing instance.
Claims ownership of assigned values, pre-ARC version of strong.
Similar to weak properties, but they don’t automatically set their value to nil if the referenced object is destroyed.
Default behavior for primitive data types, and it used to be a way to implement weak references before iOS 5