• 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: How i can get to a NSString a selected text in a NSTextView ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >How i can get to a NSString a selected text in a NSTextView ? (From: SoK <email@hidden>)

  • Prev by Date: Re: How i can get to a NSString a selected text in a NSTextView ?
  • Next by Date: Icon in NSTabViewItem label
  • Previous by thread: Re: How i can get to a NSString a selected text in a NSTextView ?
  • Next by thread: NSComboBox initialFirstResponder and nextKeyView Outlets
  • Index(es):
    • Date
    • Thread