• 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
Re: Case insensitive autocomplete
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Case insensitive autocomplete


  • Subject: Re: Case insensitive autocomplete
  • From: Shaun Wexler <email@hidden>
  • Date: Wed, 23 Mar 2005 13:46:47 -0800

On Mar 23, 2005, at 12:19 PM, Nicko van Someren wrote:

The biggest problem with using poseAsClass is that it's only useful if you want all your combo boxes to behave the same way.

No problem; just add a category, such as:

@interface NSComboBox (CaseInsensitiveCompletion)
- (BOOL)usesCaseInsensitiveCompletion;
@end

@implementation NSComboBox (CaseInsensitiveCompletion)
- (BOOL)usesCaseInsensitiveCompletion {
	return NO;
}
@end

@interface CaseInsensitiveComboBox : NSComboBox
- (BOOL)usesCaseInsensitiveCompletion;
@end

@implementation CaseInsensitiveComboBox
- (BOOL)usesCaseInsensitiveCompletion {
	return YES;
}
@end

@interface PosedAsNSComboBox : NSComboBox
@end

@implementation PosedAsNSComboBox

- (NSString *)completedString:(NSString *)substring
{
	if (![self usesCaseInsensitiveCompletion] || [self usesDataSource]) {
		return [super completedString:substring];
	}
	// else perform case-insensitive completion, etc...
}

@end
--
Shaun Wexler
MacFOH
http://www.macfoh.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >Case insensitive autocomplete (From: Ian was here <email@hidden>)
 >Re: Case insensitive autocomplete (From: Robert Martin <email@hidden>)
 >Re: Case insensitive autocomplete (From: Nicko van Someren <email@hidden>)

  • Prev by Date: Re: [OT] How to be a real programmer
  • Next by Date: Null result from NSArray objectAtIndex
  • Previous by thread: Re: Case insensitive autocomplete
  • Next by thread: Re: Case insensitive autocomplete
  • Index(es):
    • Date
    • Thread