The @property property

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

1. A read-write attribute(readwrite/ readonly)

The default is readwrite, indicating the attribute can be read, can also assign a value to the variable; readonly represents only read the attribute variables.

2. An atomic property (atomicity/nonatomic)

Atomic properties, atomic is the default value, attribute that is atomic, support access to multiple threads (in the setter joined the synchronous lock), the latter is not atomic, suitable for improving efficiency in non multithreaded environment, did not join the synchronous lock.

3. The Setter property (assign/retain/copy)

If the property is of type object, you need to use the retain, assign, copy parameters, said setter method of internal implementation, holding the object mode. Where retain is the increase of reference counting, strong reference types. Direct assignment assign is variable, weak reference types, is the default value. Copy is the setter parameter copy it again, and then assigned to a member variable.   if you don't give a held object mode, the compiler will warn.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Richie at November 22, 2013 - 11:11 AM