I am checking on how to write Singleton class on iOS. According to the web site (http://www.galloway.me.uk/tutorials/singleton-classes/), I understand that without the use of ARC, I need to use allocWithZone function to allocate my class itself.
My key question is … how can the memory of my class (after alloc or allocWithZone) be freed later ? Who is responsible for the memory ?
Thanks.
if you want to “free the memory” during
-(id) inityou can setself = nil;