• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Newbie Q : writing into a text view programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie Q : writing into a text view programmatically


  • Subject: Re: Newbie Q : writing into a text view programmatically
  • From: "Alan Smith" <email@hidden>
  • Date: Fri, 7 Jul 2006 08:26:04 -0400

Do you mean something like:

[textView setString: @"Hello World"];

You can also use something like:

[NSString *text = [textView string];
[textView setString: [text stringByAppendingString: @"Hello World"]];

That would append Hello World on to the current text in the view. That
could be really slow if you have a largish amount of text in the view.
I suggest looking in the docs. There are methods like [textView
replaceCharactersInRange:] and stuff that should be much faster.

Cheers, Alan

On 7/7/06, email@hidden <email@hidden> wrote:

Hello all,

 is there a simple way to implement the following action
(say, a method in a subclass of NSTextView) :

    -(void)writeOut: (NSString*) s;

which makes the text view change (along with all
the data associated with it, such as the text conatiner
and the layout manager) exactly as if the user had
typed the string s on the keyboard ?

                            Ewan



 _______________________________________________
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



--
// 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."
"Don't waste your life doing things others have already done."
_______________________________________________
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


References: 
 >Newbie Q : writing into a text view programmatically (From: email@hidden)

  • Prev by Date: [newbie]How to pop a window?
  • Next by Date: Re: more on two-way bindings and one-way bindings
  • Previous by thread: Re: Newbie Q : writing into a text view programmatically
  • Next by thread: Newbie Q : writing into a text view programmatically
  • Index(es):
    • Date
    • Thread