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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to