3 ms·
The difference is there is core support for reference counting and cleaning up unreferenced items. Any time you are using an object, you grab a reference; at th
by SoftwareMaven 16y ago
The difference is there is core support for reference counting and cleaning up unreferenced items. Any time you are using an object, you grab a reference; at the end of a call chain (managed as a part of message passing), if an item has no references, it will be deleted automatically.
With C, you are forced to care who actually allocated something and figure out a protocol for dealing with getting it released.
With Objective C, I can allocate something, hold my reference for the duration of the call, release my reference and return it. If the caller wants a reference, they can then grab it; if they don't, it will get deleted.