Given the numbers in your post, "3-5", "250" and "several", I'd say you should just split the phrase into words, write an outer loop for(words in phraseWords), an inner loop for(tag in tags), and inside it all compare using -isEqualToString, breaking when found. "Just do it."

You won't even know that this happened unless you log the millseconds. I'd bet that the amount of time you spend writing this code is going to exceed the the CPU minutes consumed by 10,000 users doing 100 searches per day over the 5-year life your app.

Only thing that might require a little digging -- I believe that there is probably a "correct" way to split a phrase into a set or array of words which will work for non-Western languages. -[NSString componentsJoinedByString:@" "] would be a cheesy solution.

_______________________________________________

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