retain/release question about Apple docs
retain/release question about Apple docs
- Subject: retain/release question about Apple docs
- From: "James W. Walker" <email@hidden>
- Date: Sun, 5 Mar 2006 17:43:07 -0800
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.
_______________________________________________
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