Re: Mutable/non-mutable bindings in NSTextView
Re: Mutable/non-mutable bindings in NSTextView
- Subject: Re: Mutable/non-mutable bindings in NSTextView
- From: Camillo Lugaresi <email@hidden>
- Date: Sat, 25 Feb 2006 19:06:41 +0100
On 25/feb/06, at 17:22, David wrote:
Yes, I missed that key step. Thanks. I've found that I can also
use willChangeValueForKey and didChangeValueForKey then do the
regular release and new allocation.
Since I will be continuously updating the NSTextView contents
programmatically as well, it appears I will have to do something
like:
[self willChangeValueForKey:@"log"];
NSString *newLogContents = [[log stringByAppendingString:@"more
contents added"] retain];
[log release];
log = newLogContents;
[self didChangeValueForKey:@"log"];
Is this correct approach?
I wouldn't use bindings for the contents of a log, unless updates are
infrequent and it's limited to a very short length.
Camillo
_______________________________________________
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