Session 2 was conducted on the same venue as, and right after the PhRUG meetup.
Attendees:
topher
rad
eumir
buddy
tin
nico
There were two new attendees, tin and nico, who promised to catch up with the previous assignments.
We discussed memory management. The following questions were raised:
When should you call release on an object?
When you’re the one who did the alloc for the object.
When should you not call release?
When you did not do the alloc for the object.
Why bother with alloc and init at all, when, for example, you can use class methods that do it for you?
For example, why use:
NSString *my_string = [[NSString alloc] initWithFormat:@"format"];
when you can instead the format below?
NSString *my_string = [NSString stringWithFormat:@"format"];
Answer: The stringWithFormat call returns an autoreleased object. On the Mac OS X desktop, there’re practically no difference. On the iPhone, you want to limit the number of objects in the autorelease pool and use alloc/init most of the time so that you can be explicit (and optimize) on when you call release.
As before, let’s try to do Week 3 in one week. That means lectures 5 (Views, Animation, OpenGL) and 6 (View Controllers), and assignment 3 (HelloPoly II). Let’s aim to view the lectures and finish the assignment by next week and have a meetup Thursday next week, February 25.
For those that are catching up and still working on previous assignments, feel free to post questions about them, both on the forum and on meetups.