NSTextView textDidEndEditing trouble
NSTextView textDidEndEditing trouble
- Subject: NSTextView textDidEndEditing trouble
- From: Joseph Heck <email@hidden>
- Date: Sun, 4 Jan 2004 15:19:18 -0800
Howdy,
I'm looking for some advice on using an NSTextView. I have an Cocoa
document-based application that has an NSTextView, NSTableView, and a
toolbar all in the same window. The data represented in the NSTextView
is "chosen" from the NSTableView selection, and can be directly edited.
I'm capturing the update information using the textDidEndEditing
delegate message (my NSDocument subclass is the delegate)
The trouble comes in when I have some sequence of events that causes
the data model to be updated and my "updateWindowDetails" method to be
called - where I draw out the updated views. At those times, I
re-display the NSTextView to whatever the data model things it should
be, and the old data gets wiped.
For example, when I have some text typed in the NSTextView, switch to
another application, and then click back to a different NSTableView
row, the UI properly updates - but I never seem to get the
"textDidEndEditing" message to the delegate and I loose that entered
information.
I've fiddled around with forcing the end of editing by issuing a
makeFirstResponder message when I find the is the firstResponder - but
I've got the feeling that I'm going about this the wrong way entirely -
because I ended up spraying that code all over the place to try and
catch the data before it gets wiped, which feels like the wrong
approach.
Any suggestions?
-joe
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.