Do I need to Start the Garbage Collector?

Discussion in 'Mac Programming' started by BadWolf13, Sep 16, 2010.

  1. macrumors 6502

    Joined:
    Dec 17, 2009
    #1
    Running through the Core Data Utility Tutorial, and it says that I need to turn on garbage collection in the build settings, and add the function call

    Code:
    objc_startCollectorThread();
    in order to "start the garbage collector." Now in all the applications I've written so far, I turned on the garbage collector in the build settings, but I never heard of this function call before. Does that mean that the garbage collector wasn't working in my previous apps, or is this requirement just for command line tools?
     
  2. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
  3. macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #3
    NSApplicationMain() calls it for you in AppKit apps. You only need to do it for commandline tools and such.
     

Share This Page