small medium large xlarge

07 Dec 2009, 20:04
Craig Donnelly (1 post)

Hi Bill,

In the second screencast (Memory Management) - In the Movie_Player.m file you do the following:

Movie *movie = [[Movie alloc] initWithTitle:[[NSString alloc] initWithString:@"iron man"]

My question is, where does the NSString (initWithTitle) that is alloc’ed above get released?

And wouldn’t it be better for it to be done like so:

 Movie *movie = [[Movie alloc] initWithTitle:@"iron man" andRating:5 andYear:2008];

Regards, Craig

You must be logged in to comment