Re: newbie: question: i have a memory leak: obj-c 2.0: modification of program in "Cocoa with Objective-C"
Re: newbie: question: i have a memory leak: obj-c 2.0: modification of program in "Cocoa with Objective-C"
- Subject: Re: newbie: question: i have a memory leak: obj-c 2.0: modification of program in "Cocoa with Objective-C"
- From: Bill Bumgarner <email@hidden>
- Date: Sun, 3 Feb 2008 13:49:56 -0800
On Feb 3, 2008, at 12:45 PM, George Greene wrote:
int main (int argc, const char * argv[]) {
Song *song1 = [ [ Song alloc ] init ];
song1.name= @"We Have Exposive" ;
[ song1 setArtist: @"The Future Sound Of Londown" ];
Song *song2 = [ [ Song alloc ] init ];
[ song2 setName: @"Loops of Fury" ];
[ song2 setArtist: @"The Chemical Brothers" ];
// Display Object
NSLog( @"Song 1: %@", song1.name );
NSLog( @"Song 2: %@", song2.name );
return 0;
}
Either enable Garbage Collection or surround the above w/an
autorelease pool. I suggest GC.
Good songs, btw.
b.bum
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden