OK, guess I qualify as "steeped" there - I still use MRC in all my
shipping apps, although I've tentatively used ARC in small fry like
build-time utilities. (Never got used to GC.)
Anyway, much of my code looks like one of these patterns:
NSDictionary* dict = [(id)CFCreateSomeCFDictionary() autorelease];
... use dict for some lines, done
NSArray* array = (NSArray*)CFGetSomeCFArray();
... use array for some lines, done
NSString* str = (NSString*)CFCreateSomeCFString();
... use str for some lines
One thing about my not migrating to ARC is that I find the bridging cast
names opaque - can't memorize them! Same, sadly, was true for the
So I'd say, use `.release` or `.autorelease` if they'd be used in the
same place as above...
On 18/12/15 16:46 , email@example.com wrote:
Date: Fri, 18 Dec 2015 11:38:31 -0800
From: Dave Abrahams <firstname.lastname@example.org>
Subject: Re: [swift-evolution] RFC: Proposed rewrite of Unmanaged<T>
> On Dec 17, 2015, at 6:23 PM, T.J. Usiyan <email@example.com> wrote:
> My main point of contention with `.release()` is that it has the *exact* same name as a method from the MRC strategy. Maybe this is a silly point, but this overlap could further complicate teaching how ARC works and in what ways it is based on MRC conventions.
> I am not of the opinion that ARC is fundamentally more difficult to understand than MRC, but I do believe that it takes a very particular kind of faith now that we don't get to manually write the retains and releases. This is completely worth it, in my opinion, but I want to avoid making it *more* confusing to explain what ARC doing at compile time.
Well, unsafeRef.release() is equivalent to
let x = $0.object
CFRelease($0) // if CFRelease() wasn't @unavailable
If you let the return value drop on the floor, it ends up being
exactly equivalent to the method with the exact same name from the
MRC strategy. So the correspondence is strong and shouldn’t be a
problem. That’s just my opinion, though, and part of the reason
we’re asking for feedback here is so people steeped in MRC like you
can argue with me about that :-), so if you find this unconvincing
please explain why.