> Really? Does this actually work? > I needed to find word boundaries to implement a Find panel which > supports searching for "Whole Words" and I ended up using > UCFindTextBreak based on advice from this list. It was a pain to > implement (since it's not designed to mesh with Cocoa at all).
Yes, it works. I had to implement my own Find panel for various reasons, too, and I used -selectionRangeForProposedRange: for exactly that: NSRangewordRange = [text selectionRangeForProposedRange:foundRange granularity:NSSelectByWord]; if(tag == FindTypeContains) searchSuccess = YES; else if ( (tag == FindTypeWholeWord) && (NSEqualRanges(foundRange,wordRange)) ) searchSuccess = YES; else if ( (tag == FindTypeStartsWith) && (foundRange.location == wordRange.location) ) searchSuccess = YES; else if ( (tag == FindTypeEndsWith) && (NSMaxRange(foundRange) == NSMaxRange(wordRange)) ) searchSuccess = YES; Best, Keith ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ _______________________________________________ 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 [EMAIL PROTECTED]