Re: autorelease - when is retain count decremented
Re: autorelease - when is retain count decremented
- Subject: Re: autorelease - when is retain count decremented
- From: Scott Stevenson <email@hidden>
- Date: Tue, 14 Sep 2004 14:55:25 -0700
On Sep 14, 2004, at 1:41 PM, justin webster wrote:
just wondering what causes the retain count of an object to drop.
this is the situation I've been wondering about:
NSString *myString = [NSString stringWithFormat:@"testing"];
myString = anotherString;
when I point myString away from the 'testing' string, does the
'testing' memory get freed?
or should I release myString before pointing it to something else?
also, in this situation do I now have two pointers to the same piece
of memory, and therefore a retain count of two?
Answering this single question won't help much. You need a basic primer
in Objective-C memory management:
Here are some:
http://www.stepwise.com/Articles/Technical/2001-03-11.01.html
http://cocoadevcentral.com/articles/000055.php
Best Regards,
- Scott
--
Tree House Ideas
http://treehouseideas.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden