On Jun 23, 2012, at 8:55 PM, Jerry Krinock <je...@ieee.org> wrote: > But now I wonder why Apple did not do this, as they did with Garbage > Collection. Methods -retain, -release, and -autorelease are no-ops when GC > is on. > > Why didn't Apple do the same thing for ARC?
Objective-C garbage collection supported a hybrid mode, where the same binary could run with or without GC enabled. Such code was written with retain/release calls in place, but those calls were ignored if you were running with GC on. This hybrid mode was used in system libraries and other code that needed to run in both GC and non-GC apps. The problem with hybrid mode is that it is difficult to keep both modes functioning. If you have retain/release statements that are ignored, and you are not truly fanatical about testing both modes, then in short order you will find that your retain/release statements are incorrect because of subsequent code changes. ARC has no need for GC's hybrid mode, because ARC code and non-ARC code are fully interoperable. We recommend each file be written for either one or the other, with no attempt to be ARC-agnostic. -- Greg Parker gpar...@apple.com Runtime Wrangler _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com