The selection information is in the NSTokenField's associated cell's field editor. This code excerpt will print the tokens selected in self.tokenField
to the console:
NSArray *objects = [self.tokenField objectValue];
NSTextView *tv = [[self.tokenField cell] fieldEditorForView:self.tokenField];
NSArray *selections =[tv selectedRanges];
for (NSValue *rangeVal in selections) {
NSRange range = [rangeVal rangeValue];
for (NSUInteger i=0; i<range.length; i++) {
NSLog(@"%@", [objects objectAtIndex:range.location + i]);
}
}