CocoaDev

Edit AllPages

I’d like to set the text completions in a column of a table view. What I’ve seen about text completion implies that I need to subclass General/NSTextView, and General/NSTableView isn’t a subclass of General/NSTextView and doesn’t seem to have a way of obtaining its textView either.

I’ve tried using an General/NSFormatter, but I haven’t even been able to make that extend what the user has typed into one of the valid strings I want. (The application is a bug tracker; I’d like to have a column for status entries that could be “Open”, “Fixed”, “Not reproducible”, etc.)

Hitting “escape” in the table does bring up a LONG list of default completions, so the basic functionality is there, I just need to figure out a way to set the completion list.

Thanks,

Norm


See General/FieldEditor. The executive summary is that editing in tables is handled by a special instance of General/NSTextView with the cell set as its delegate, so you can just subclass that and use the text completion delegate methods. —-

Fast reply!

I’ve tried some code based on the examples in General/FieldEditor and General/CustomFieldEditor without any luck so far.

// in General/MyDocument.h

// This method functions as I expect

// This one never gets called, and I can’t figure out why

Any thoughts on what I’m forgetting?