Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Garbage collection

I know about iOS Automatic Reference Counting, which is compiler based feature. But, i have been going through many sites and confused with whether Garbage collection is also there or not on iOS program development? I know, ARC and GC is different each other. Some links says, GC is available for iOS and some links says GC is available only for Mac OS X development. But, i couldn't conclude saying whether the GC is there or not on iOS development? Please direct me the right path or link so that i can understand about it and try programming.

Thanks!

like image 533
Daisy Avatar asked Oct 10 '12 04:10

Daisy


2 Answers

iOS has no method of Garbage Collection. Even so, Garbage Collection is entirely unnecessary (for all practical purposes) when ARC is used. ARC works its magic at compile time to do the reference counting for you thereby making it unnecessary (and actually non-allowed) to use any other sort of memory management.

Edit:

To clarify, OS X does currently support garbage collection, but it is deprecated (unbeknown to me until a few minutes ago) as of OS X Mountain Lion. iOS never has and never will support garbage collection. Any advantages of garbage collection are moot when compared to those of ARC, and Apple has made the move to (forcefully) nudge us in the right direction.

like image 119
zachjs Avatar answered Oct 29 '22 04:10

zachjs


iOS does not have garbage collection

like image 29
geraldWilliam Avatar answered Oct 29 '22 05:10

geraldWilliam