• 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: How is "Apple + Ctrl + D" implemented?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How is "Apple + Ctrl + D" implemented?


  • Subject: Re: How is "Apple + Ctrl + D" implemented?
  • From: Keith Blount <email@hidden>
  • Date: Tue, 29 Apr 2008 12:12:33 -0700 (PDT)

> 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 (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: How is "Apple + Ctrl + D" implemented?
      • From: John Stiles <email@hidden>
  • Prev by Date: Re: Counting instances in Core Data
  • Next by Date: transient attributes of NSManagedObject reflected in isUpdated
  • Previous by thread: Re: How is "Apple + Ctrl + D" implemented?
  • Next by thread: Re: How is "Apple + Ctrl + D" implemented?
  • Index(es):
    • Date
    • Thread