This is slightly confusing for me because I’m reading an Objective-C book from 2009 (it’s the only edition my library had) and the author constantly reminds the reader to release memory, but I get an error when I try to use this method. I read up a little about it and I found out that the release method is deprecated, but is there something I need to do instead of the release method to manage memory, or does Objective-C have garbage collection now?
For example:
NSString *s = [[NSString alloc] init];
[s release];
It is not garbage collection but
Automatic Reference Counting(ARC) at work for you.To follow the examples in your book, create a new project in Xcode and deselect the option to use ARC.