Re: Question about garbage collection
Re: Question about garbage collection
- Subject: Re: Question about garbage collection
- From: Oftenwrong Soong <email@hidden>
- Date: Mon, 11 Jan 2010 12:40:49 -0800 (PST)
I believe it will because there will be no pointer to each allocated string after a new one is allocated. Note that it won't be deallocated immediately. It will be deallocated when the collector runs.
----- Original Message ----
From: Michael Abendroth <email@hidden>
To: email@hidden
Sent: Sun, January 3, 2010 9:59:01 AM
Subject: Question about garbage collection
Hi all,
When I write something like:
while (true) {
NSString *s = [[NSString alloc] initWithString:@"applejuice"];
}
Will s be garbage collected? If not, how can I make sure it does get
deallocated by garbage collection.
_______________________________________________
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
_______________________________________________
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