Я действительно узнал, как это сделать, используя методы делегата проверки орфографии NSTextView:
- (NSArray *)textView:(NSTextView *)view didCheckTextInRange:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary *)options results:(NSArray *)results orthography:(NSOrthography *)orthography wordCount:(NSInteger)wordCount {
for (NSTextCheckingResult *result in results) {
if (result.resultType == NSTextCheckingTypeCorrection) {
NSLog(@"autocomplete has occured! %@", result);
}
}
return results;
}