News for hackers. Stuff that matters.
Re:Sony's next-gen application platform built on Objective C... by SoftwareMaven on Thursday November 25, 2010 @03:51AM (#1939757)
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.

There are no comments on this comment yet.