NSSearchField loses focus
NSSearchField loses focus
- Subject: NSSearchField loses focus
- From: Peer Allan <email@hidden>
- Date: Wed, 21 Jan 2004 11:18:51 -0600
Using a custom NSArrayController I am searching a table below is my
searching code.
- (NSArray *)arrangeObjects:(NSArray *)objects {
if (searchString == nil) {
return objects;
}
NSMutableArray *filteredObjects = [NSMutableArray
arrayWithCapacity:[objects count]];
NSEnumerator *objectsEnumerator = [objects objectEnumerator];
id item;
while (item = [objectsEnumerator nextObject]) {
if ([[item valueForKeyPath:@"name"] rangeOfString:searchString
options:NSCaseInsensitiveSearch].location != NSNotFound) {
[filteredObjects addObject:item];
}
}
return [super arrangeObjects:filteredObjects];
}
This is almost straight out of Apple's docs.
The problem is that when I try to do a live search. The search field
loses focus and interrupts my typing of the query when the Controller
returns results from what I have entered up to that point (usually 2 or
3 character). Any ideas where I should look to solve this?
Peer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.