CFRetain C string with garbage collector enabled

I read this http://lists.apple.com/archives/objc-language/2011/Mar/msg00084.html

This is a long (interesting) stream, and I might have missed the point ...

This bit caught my eye

    char* path = [string fileSystemRepresentation];
    CFRetain (path);
    int result = open (path, ...);
    CFRelease (path);

I know that you cannot do this when garbage collection (char * is not CFType). Does this do anything when garbage collection is enabled?

My idea is that this is a mistake, or it is not actually offered as a solution, although I read it that way.

+3
source share
1 answer

, ; CFRetain CFTypes. C / , GC. non-GC , , . , .

; char *, , , , .

+1

All Articles