CF and Retain?

Discussion in 'Mac Programming' started by MorphingDragon, Aug 15, 2009.

  1. MorphingDragon macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #1
    Is it really so important to learn these functions? I mean, I have a limit which I need to get a (Highly Paid) project done and I do not need or intention to develop for Tiger. What is CF actually used for and Garbage Collector is a lot simpler than Retain.
     
  2. Guiyon macrumors 6502a

    Joined:
    Mar 19, 2008
    Location:
    North Shore, MA
    #2
    If you are using CoreFoundation, there is garbage collection but you still need to use the CFRetain/CFRelease pairings as the garbage collector will not collect anything with a non-zero retain count and there are a few gotchas as to when the object is actually deallocated. I'd suggest reading through the below material as it details the Cocoa/CoreFoundation memory management schemes.

    If you are using Objective-C with Cocoa/Foundation, read these:
    Garbage Collection Programming Guide
    Memory Management Programming Guide for Cocoa

    If you are using C and CoreFoundation (as I see you referenced a CF- prefix):
    Memory Management Programming Guide for Core Foundation
     

Share This Page