Re: Seeking debugging advice
Re: Seeking debugging advice
- Subject: Re: Seeking debugging advice
- From: David Aames <email@hidden>
- Date: Fri, 27 Oct 2006 21:49:35 +0100
Hey Alan,
Thanks for that. On my way to work today it suddenly hit me what the
problem was - NSTextView's storage. NSTextView uses a NSMutableString
so all address locations we using the same string and that's why the
watchpoint was called only once. So the solution is to copy the
string before assigning it as the property of your custom object.
On 27 Oct 2006, at 15:19, Alan Smith wrote:
Hey David,
I've written several programs that heavily use NSTextView. In all of
them I've had to do this:
NSString *text = [NSString stringWithContentsOfFile: @"/…"];
[textView setString: @""];
[textView setString: text];
The part you should take note of is where I set the string to a blank
string. I would have a whole files worth of text in the view and then
change it to the contents of another file. If I didn't have that line
that first set the string to a blank one I would get some funky bugs.
The text on screen wouldn't change and when I tried to edit it I would
get weird errors.
Hope this helps, Alan
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that religion really is unimportant, then it
shall evolve."
_______________________________________________
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