Re: NSView subclass bindings? NSTextView?
Re: NSView subclass bindings? NSTextView?
- Subject: Re: NSView subclass bindings? NSTextView?
- From: Kurt Marek <email@hidden>
- Date: Mon, 10 Nov 2003 16:05:17 -0800
I have an NSString that I want to put into an NSTextView. The only
reason for doing this is that the string is fairly long and it would be
nice to have the vertical scroll bar. What's the easiest way to hook up
the bindings given that NSTextView is looking for RTFD data? Do I have
to convert the string to NSData, like so?
NSData *data = [NSKeyedArchiver archivedDataWithRootObject: string];
Thanks,
Kurt
On Nov 9, 2003, at 11:17 PM, Terrence Talbot wrote:
On Nov 9, 2003, at 10:44 PM, mmalcolm crawford wrote:
On Nov 9, 2003, at 7:04 PM, mmalcolm crawford wrote:
The tool tip for the data binding says that this is for an
NSTextStorage object. Makes sense, but how do you hook that up?
Looks like it's actually expecting an NSMutableData...
A little more investigation: it *seems* it's actually RTFD data...
Yes, I discovered this, too, after implementing your suggestion. It
would seem, then, that the IB tool tip for the binding is incorrect,
or am I missing something else here?
I was actually also hoping to bind an NSTextView to a derived value.
E.g., imagine the simple case of one text view that takes input,
displaying it as plain text, a companion text view then redisplays the
same text in bold when focus changes. I had anticipated dealing with
mutable attributed strings, rather than a typed streams of rtf. Is
there a known shortcut to unpacking the data, fiddling with the data,
and packing it back up? I admit that I try not to deal with rtf all
that often. All those twips...
Thanks much,
Terrence
_______________________________________________
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.
_______________________________________________
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.