Hi all,

I'm currently implementing custom autocomplete functionality into a
NSTextField. I've managed so far to generate a list of my own available
words and these show when escape is pressed.

However, I'd like the autocompletion to automatically show as the user
types.

I'm using the delegate methods of a NSTextView to override -
(NSArray*)textView:(
NSTextView *)textView completions:(NSArray *)words
  forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger*)index

And setting the delegate in - (void)controlTextDidBeginEditing:(
NSNotification *)obj {

  fieldEditor = [[obj userInfo] objectForKey:@"NSFieldEditor"];

  [fieldEditor setDelegate:self]; }
Where fieldEditor is a NSTextView declared in the .h file.

The issue is that I was previously using the delegate methods for
NSTextField  (controlTextDidChange, controlTextDidEndEditing, etc..) and as
soon as I set the fieldEditor delegate these methods are no longer called.
I'm not really sure what I'm missing here, is there some incompatibility
with setting delegates for a NSTextField and its field editor?

I'm still trying to get my head around interacting with the field editor and
the google results I've read have helped but not answered my problems.

Thanks,
Joe

-- 
Joe White
Production Department, RjDj

Tel : +44 7515 731499

Reality Jockey Ltd.
Floor B “The Mission”
55 Holywell Lane
London
EC2A 3PQ
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to