• 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: Extract plain text content from a Text View
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extract plain text content from a Text View


  • Subject: Re: Extract plain text content from a Text View
  • From: "I. Savant" <email@hidden>
  • Date: Fri, 16 Oct 2009 15:51:06 -0400

On Oct 16, 2009, at 3:44 PM, I. Savant wrote:

I want to figure out a way to build a search predicate that will allow me to search a Text View and I think this is likely to be the only way.

Seems a bit odd. Could you elaborate?

Let *me* elaborate on *that*. :-) You normally use predicates to filter objects in the model layer of your application. Note "normally". If you're trying to provide a way to search within a text view, this is a very strange way of going about it:


1 - NSTextView already takes advantage of the Find field.

2 - Searching for a substring inside a string with a predicate searches the *whole* string as one ... this is only really useful if your text view's content is made up of a bunch of smaller units, but then again ... see 1 above.

3 - The predicate would be used to filter an array of NSTextStorages, not one NSTextStorage, returning those which contain your search string.

4 - Related to 3: if you're searching text storages because you treat them as individual subunits in your model, it would likely make more sense to apply this filter to the model layer.

--
I.S.




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Extract plain text content from a Text View
      • From: Ian Piper <email@hidden>
References: 
 >Extract plain text content from a Text View (From: Ian Piper <email@hidden>)
 >Re: Extract plain text content from a Text View (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Extract plain text content from a Text View
  • Next by Date: Re: A good Obc-C framework for sending email?
  • Previous by thread: Re: Extract plain text content from a Text View
  • Next by thread: Re: Extract plain text content from a Text View
  • Index(es):
    • Date
    • Thread