November 2013
Beginner
325 pages
9h 47m
English
As mentioned at the beginning of Chapter 21, before automatic reference counting (ARC) was added to Objective-C, you had manual reference counting, which used retain counts. With manual reference counting, ownership changes only happened when you sent an explicit message to an object that decremented or incremented the retain count.
[anObject release]; // anObject loses an owner [anObject retain]; // anObject gains an owner
You would see these sorts of calls primarily in accessor methods (where the new value was retained and the old value was released) and in dealloc methods (where all the previously retained objects were released). The setHolder: method for BNRAsset ...
Read now
Unlock full access