• 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
Get the text from a NSTextView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Get the text from a NSTextView?


  • Subject: Get the text from a NSTextView?
  • From: Lorenzo Puleo <email@hidden>
  • Date: Thu, 19 Dec 2002 17:24:42 +0100

I have put some text into an NSTextView using:
[myTextView readRTFDFromFile:myFile];
It works well.

Now I want to perform a seach into this text:
foundRange = [myTextView
rangeOfString:@"textToSearch"
options:NSLiteralSearch
range:NSMakeRange(0,[myTextView length])];

But it doesn't work. If instead of myTextView I put a NSString*, it works.
So, how to get the content of a NSTextView as NSString*?
Since the text could be very long I wouldn't get a duplicate of the text,
but I would get only a pointer to the text.
Thanks.

--
Lorenzo Puleo
mailto:email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • FW: Get the text from a NSTextView?
      • From: Lorenzo Puleo <email@hidden>
    • RE: Get the text from a NSTextView?
      • From: "Jonathan E. Jackel" <email@hidden>
    • Re: Get the text from a NSTextView?
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Newbie NSWindow question
  • Next by Date: Re: Class method list
  • Previous by thread: Re: Newbie NSWindow question
  • Next by thread: Re: Get the text from a NSTextView?
  • Index(es):
    • Date
    • Thread