Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Appending NSStrings to an NSTextView



Le lundi 31 dicembre 2001, ` 08:15 , David Rehring a icrit :

I need to append an NSString to an NSTextView and there doesn't seem to be a
non-hackish way of doing it.


Use [myTextView insertText:mytext].
This inserts the text at the current selection point, so you may need to pu it at the end if you wish to append text:
[myTextView setSelectedRange:NSMakeRange([[myTextView textStorage] length]
);

If your text view is not editable, you need to make it so temporarily by clling setEditable:YES before and setEditable:NO after.

Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.


References: 
 >Appending NSStrings to an NSTextView (From: David Rehring <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.