• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Case insensitive autocomplete
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: image larger than 32*32 in toolbar
  • Next by Date: Re: image larger than 32*32 in toolbar
  • Previous by thread: Re: Case insensitive autocomplete
  • Next by thread: NSMutableArray, NSArrayController and NSTableView
  • Index(es):
    • Date
    • Thread