• 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
NSTokenField asynchronous autocompletion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTokenField asynchronous autocompletion


  • Subject: NSTokenField asynchronous autocompletion
  • From: Erik Hinterbichler <email@hidden>
  • Date: Mon, 6 Jul 2009 01:05:58 -0700

Hello,

I'm using NSTokenField and I've implemented the delegate method "tokenField:completionsForSubstring:indexOfToken:indexOfSelectedIted:" to provide autocompletion. However, I don't have the list of autocompletions stored locally; I have to make a call to an API over the Internet, and I want to do this asynchronously so that there aren't any pauses while typing.

Currently my delegate method is set up so that I first check my local cache to see if the completion list is there for the given substring, and I return it if so. If not, I make the asynchronous call and then return 'nil'. In my asynchronous callback method, I populate my local cache with the returned completion list. However, the auto complete list never shows up because I initially returned 'nil' in the delegate method.

I'm wondering if there's a way to programatically trigger the delegate method from my callback function? Or, if using delegate method is the wrong way to go for asynchronous completions, what is the best way that I might accomplish this? I believe the Safari 4 Google suggestions search field is doing something similar to what I want to do, but I'm not sure how it's implemented.

Thanks,
Erik


_______________________________________________

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


  • Prev by Date: Re: Solved: Not receiving notifications on NSArrayController selection changes
  • Next by Date: Re: CoreData deleteAll of kind
  • Previous by thread: Re: Layout NSTextAttachment
  • Next by thread: TableView displaying a zillion empty rows
  • Index(es):
    • Date
    • Thread