views:

160

answers:

1

How would one implement a custom auto-complete pop-up menu like Xcode has?

At the moment I can only put custom auto-completions using

- (NSArray *)textView:theTextView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(int *)index 

I want a bit more flexibility than this.

Cheers!

MT

+1  A: 

Xcode (and other apps) use a custom auto-completion view. You can bring up your view at the correct location using the text view's layout manager's method locationForGlyphAtIndex: (which return an NSPoint).