Implementation of the Assign, retain, and copy three attributes when assigning a value to a property using the Set Value method
Self.property = newvalue;
The Assign feature would be this:
property = NewValue;
The retain feature would be like this
if (property!=0) {
[Property release];
property = [NewValue retain];
}
The feature of copy is this
if (property!=0) {
[Property release];
property = [newvalue copy];
}
If you want to keep an object from being destroyed you can use retain, and release is required after you have finished using the object.
Releasing a message to an object does not release the object, but is not destroyed until the object's reference count is 0. The system then sends a DEALLOC message to the object to free up memory.
There is no need to use an object in the method, but this object does have a return value that can send a autorelease message to this object to mark the object's deferred release, Autorelease does not affect the object's reference count.
Manual reference Counting in rules