10

I am looking for a way (or code) to have a completion list close to the one of xcode xcode completion

Do you know how to achieve this?

Thanks and regards,

AP.
  • 5,205
  • 7
  • 50
  • 94

1 Answers1

8

Use the

- (NSArray *)textView:(NSTextView *)textView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index

method of NSTextViewDelegate. This is called whenever text completion is initiated (either by the user, by pressing Esc or F5, or programmatically, by calling -[NSTextView complete:].

You'll need to do some fancy overriding to make it look like the one in Xcode, however. The stock implementation displays only plain text in the system font.

Aderstedt
  • 6,301
  • 5
  • 28
  • 44