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 (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