Arc is “Magic … !”

ArcMagic

I’ve been stubbornly  avoiding ARC automatic reference counting  for a long while. Feeling like a “real” programmer manages their own memory. But out of desperation; a persistent bug and a bunch of leaks, I finally gave it a try…Man I should have done this years ago !

I used these two sources to walk me through it..

Dave: Migrating to ARC 

Ray: Beginning ARC 

And after a little of shifting things around and changing a few lines, and 45 minutes later I was done.

The hardest part was figuring out that code named: “loadifNecessary”  had to be renamed to “initLoadifNecessary” since it had a reference to self.  After … I went from 8 meg of leaks to 16 bytes !!!

My take away.. ARC is MAGIC !!! use it !!