• 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: NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView


  • Subject: Re: NSTextView
  • From: "John C. Randolph" <email@hidden>
  • Date: Sat, 25 Aug 2001 13:46:47 -0700

On Saturday, August 25, 2001, at 09:54 AM, Johan Lindberg wrote:

-- Humm... You've probably gotten this question before, but since I just joined this list, you're gonna get it again, whether you like it or not.

How do I put text, programatically, in a NSTextView? I've looked everywhere for a method to do this, but I haven't found any. I want to make a log window, and I need to be able to append strings to it....

Appending text is the same as inserting text, so you can use a category to add an append method like this:

@implementation NSText(appendString)

- (void) appendString:(NSString *) sString
{
[self replaceCharactersInRange:NSMakeRange([[self string] length],0) withString:stringToAppend];
}

@end

And then just send -appendString: messages to your NSTextView whenever you have something to append.

-jcr


Support your right to protest a criminal nut-cult. http://freehenson.da.ru/


References: 
 >NSTextView (From: Johan Lindberg <email@hidden>)

  • Prev by Date: NSDictionary and Java
  • Next by Date: Re: Debugger and Object State
  • Previous by thread: Re: NSTextView
  • Next by thread: Re: NSTextView
  • Index(es):
    • Date
    • Thread