Case insensitive autocomplete
Case insensitive autocomplete
- Subject: Case insensitive autocomplete
- From: Ian was here <email@hidden>
- Date: Wed, 23 Mar 2005 16:18:56 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Thanks guys for pointing me in the right direction. I
got the NSComboBoxCells in my NSTableView to do case
insensitive autocomplete.
Here is my solution:
- (NSString *)comboBoxCell:(NSComboBoxCell *)aComboBox
completedString:(NSString *)uncompletedString
{
NSString *tempString;
int uncompletedStringLength = [uncompletedString
length];
int i;
for ( i = 0; i < [importItemTypes count]; i++ )
{
tempString = [[importItemTypes objectAtIndex:i]
substringWithRange:NSMakeRange( 0,
uncompletedStringLength )];
if ( [uncompletedString
caseInsensitiveCompare:tempString] == NSOrderedSame )
{
return [importItemTypes objectAtIndex:i];
}
}
return uncompletedString;
}
Please note that "importItemTypes" is an
NSMutableArray and serves as the NSComboBoxCell's data
source.
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
_______________________________________________
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