Re: Case insensitive autocomplete
Re: Case insensitive autocomplete
- Subject: Re: Case insensitive autocomplete
- From: Nicko van Someren <email@hidden>
- Date: Wed, 23 Mar 2005 17:53:31 +0000
On 23 Mar 2005, at 17:29, Sherm Pendley wrote:
On Mar 23, 2005, at 12:11 PM, Nicko van Someren wrote:
The class NSComboBoxCell has a message completedString: which handles
the completion process. I suspect you'll need to subclass the cell
class and reimplement this to do case insensitive completion.
An option that doesn't involve subclassing is to use a data source
object for your combo box. The NSComboBoxDataSource informal protocol
includes an optional -comboBox:completedString: method.
Yes, clearly if you are using a data source then this is a much better
way to do this. When I was faced with the problem the contents of the
list was bound to another object using bindings so I didn't have the
option of using a data source.
Also, in my posting I wrote:
NSArchiver *a = [[NSArchiver alloc] initForWritingWithMutableData:
[NSMutableData dataWithCapacity: 256]];
[a encodeClassName: @"NSComboBoxCell" intoClassName: @"MyComboCell"];
[a encodeRootObject: [self cell]];
[self setCell: [NSUnarchiver unarchiveObjectWithData: [a
archiverData]]];
I ddid this before I knew much about keyed archivers. If you were to
go this route now you'd be better off using a Keyed Archiver instead
and call setClassName:forClass: instead of the
encodeClassName:intoClassName: as this would be more likely to work for
subclasses of your cell where you wanted to be able to have your own
initWithCoder: implementation for your own extensions to the class.
Cheers,
Nicko
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden