Automatic Reference Counting ?

Discussion in 'iOS Programming' started by Branskins, Jun 6, 2011.

  1. macrumors 6502a

    Joined:
    Dec 8, 2008
    #1
    On the iOS 5 technology page in the dev center it says:
    Automatic Reference Counting (ARC) for Objective-C makes memory management the job of the compiler. By enabling ARC with the new Apple LLVM compiler, you will never need to type retain or release again, dramatically simplifying the development process, while reducing crashes and memory leaks. The compiler has a complete understanding of your objects, and releases each object the instant it is no longer used, so apps run as fast as ever, with predictable, smooth performance.

    Was this in there before?
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Sounds very cool. All the advantages of garbage collection without the overheads!
     
  3. macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #3
    So this means alot more newbie developers will have a try to this iOS development. oh oh.. :apple:
     
  4. thread starter macrumors 6502a

    Joined:
    Dec 8, 2008
  5. macrumors 68030

    MattInOz

    Joined:
    Jan 19, 2006
    Location:
    Sydney
    #5
    Or experienced developers getting to the nut of the problem quicker.
    So the value comes from solving problems for either group, not just from understanding an obscure language.

    I know I'm bring forward joining the Dev Program as a newbie because of lots of new API's hinted at in iOS5 that i think are going to make the job of creating the function I want easier. Maybe easier is the wrong word, more direct.
     
  6. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    From the quick scan-through of the documentation there are almost as many rules required for this as there are for the existing memory management rules (which are actually very simple and easy to follow) :p
     
  7. macrumors 6502a

    Joined:
    Nov 24, 2005
    #7
    You just need to stay pure Objective-C and use properties as much as possible. Really not that hard.
     
  8. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    For many I suspect that will be just fine. I have a bit of an issue that I use singletons quite a lot (I suspect this is a stylistic error with my code) and have old-school singletons that follow Apple's recommended code for this from a couple of years back where I override release/autorelease etc thus breaking ARC.
     
  9. macrumors 6502

    Joined:
    Jul 4, 2009
    #9
    You say this as if it's a bad thing. Are people not supposed to learn new things? :confused:

    If that is in fact what you mean, get over yourself.
     

Share This Page