I was looking at NSTokenField, NSTextField and NSTextView with no luck to do the following:
I am writing a Twtitter client and when you want to twitter a new Tweet then you begin to write in a text field for example:
Going to make coffee, @pe
When you begin to write a @
then I would like to help the user to autocomplete the username for example @peter
. I have a NSArray with the usernames like:
NSArray *usernames = [NSArray arrayWithObjects:@"@andreas", @"@clara", @"@jeena", @"@peter"]
What should I do to enable a simple autocompletation? I'd be happy if you would have to press F5 or something for starters too. The problem I am having is that with NSTokenField I don't know how I should tokenize the string, with NSTextField it only works when I write the @username at the beginning of the tweet and NSTextView seems really complicated and too much for such a simple thing.