Re: How i can get to a NSString a selected text in a NSTextView ?
Re: How i can get to a NSString a selected text in a NSTextView ?
- Subject: Re: How i can get to a NSString a selected text in a NSTextView ?
- From: "John C. Randolph" <email@hidden>
- Date: Tue, 12 Mar 2002 14:30:07 -0800
On Tuesday, March 12, 2002, at 02:16 PM, SoK wrote:
Hello !
How i can get to a NSString a selected text in a NSTextView ?
I have found how to replace ... but no how to get ...
You take a substring from the text storage's string:
NSTextView *myTextView;
NSRange where = [myTextView selectedRange];
NSString *selectedString = [[[myTextView textStorage] string]
substringWithRange:where];
HTH,
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
_______________________________________________
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.