Re: How do you set the text in an NSTextView?
Re: How do you set the text in an NSTextView?
- Subject: Re: How do you set the text in an NSTextView?
- From: Kyle Sluder <email@hidden>
- Date: Fri, 7 May 2010 09:29:45 -0700
On May 7, 2010, at 7:33 AM, G S <email@hidden> wrote:
Hi all. I have a couple of tabs on my window, each of which has an
NSTextView. You have to declare the IBOutlet variable in the app
delegate
as an NSScrollView; only by doing that can you get the outlet to
show up on
the Control-drag to the widget in Interface Builder.
No you don't. You just need to make sure that you try to wire up the
right object.
So I have the outlets connected, but an attempt to call setTextValue
on the
textview results in an "unrecognized selector" report. How do you
set the
text in the textView? I tried getting the text container, but no
dice.
Does NSScrollView claim to respond to -setTextValue:? Does *anything*
claim to respond to -setTextValue:?
You can't make up method names and send them to arbitrary objects
expecting things to work. The NSTextView documentation describes the
methods it responds to. Wire up your text view rather than it's
enclosing scroll view and use those methods to accomplish your goal.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden