Apple has developed a callback method that can verify that the new tokens added to the NSTokenField are valid:
- (NSArray *)tokenField:(NSTokenField *)tokenField shouldAddObjects:(NSArray *)newTokens atIndex:(NSUInteger)index
I implemented this, and it turns out that it works fine, except for one case. If the user begins to enter a token, but has not yet completed entering the token, and the user presses the TAB key, the verification method is not called.
This means that I can guarantee that all entered tokens are valid, if the user does not work, they can click the tab to bypass the check.
Does anyone know what is the right way to deal with this situation?
objective-c cocoa nstokenfield
Jacob
source share