Re: retain/release question about Apple docs
Re: retain/release question about Apple docs
- Subject: Re: retain/release question about Apple docs
- From: Ricky Sharp <email@hidden>
- Date: Sun, 5 Mar 2006 20:28:36 -0600
On Mar 5, 2006, at 7:43 PM, James W. Walker wrote:
In Apple's "Text System Overview", under "Building a Text Editor in
15 Minutes", there is the code:
- (void) setString: (NSAttributedString *) newValue {
if (mString != newValue) {
[newValue retain];
if (mString) [mString release];
mString = [newValue copy];
[newValue release];
}
}
I thought I understood the retain/release/autorelease business, but
I can't see the need for the [newValue retain] and [newValue
release] here.
See the following link; it illustrates reasons to use the many
different accessor patterns:
<http://www.stepwise.com/Articles/Technical/2002-06-11.01.html>
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.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