PDA

View Full Version : GC in iPhone apps




Nefigah
Sep 20, 2009, 08:52 PM
Hello, I'm just now learning some ObjC/Cocoa programming with the goal of doing some iPhone development eventually. I'm reading a book called Cocoa Programming for Mac OS X, 3rd Ed. I'm to the part where he is discussing memory management.

A couple questions, if I may:

1) Can the GC be used in iPhone apps? If so, is it recommended?
2) Assuming it can, is it as stupid as it seems to be from the examples in the book? Right now he's explicitly setting pointers that he's done with to nil; this would be silly in most of the managed languages I'm familiar with. Can the GC really not tell when something isn't needed by itself?



Darkroom
Sep 20, 2009, 09:56 PM
iPhone does not support garbage collection

xGrill
Sep 21, 2009, 12:38 AM
I wrote a tutorial on memory management that might help you here

http://chrisalvares.com/blog/?p=26