by pornel · 15y ago · 0 comments
In Objective-C there's no owner, everyone borrows objects. You increase retain count (if you want to hold object for longer than lifetime of a function), and you decrease retain count when done.
And there are few methods to increase (retain, init, copy, new, property assignent) and few to decrease count (release, autorelease, nil property assignment).
To me it's that simple.
You'd avoid creating circular structures as much as possible. You can get pretty far that way.
But in the real world, reference-count based GC just has limited usage.
And in theory it doesn't fare much better. Proper garbage collection can have better performance, and does the Right Thing.