Re: Filtering tableview problems
Re: Filtering tableview problems
- Subject: Re: Filtering tableview problems
- From: mmalcolm crawford <email@hidden>
- Date: Tue, 24 Feb 2004 00:07:03 -0800
On Feb 23, 2004, at 11:35 PM, Scott Anguish wrote:
also, just to follow up, another bug is that if searchField is nil you
need to call super
finally, you need to retain that string below..
And a little more...
- (NSArray *)arrangeObjects:(NSArray *)objects {
if (searchString == nil) {
return [super arrangeObjects:objects];
}
It's probably also worth testing:
if ([searchString isEqualToString:@""]) {
return [super arrangeObjects:objects];
}
And another issue to be aware of (kudos to Gabriele de Simone for
spotting it) is that, if you allow the user to add new objects whilst
the controller is being filtered, any insertion that does not match the
filter will fail. You can work around this with "a bit of a hack": you
can keep a track of the most-recently added object, and in
arrangeObjects: unconditionally add it to the arrangeObjects array.
I'm still not sure this is the best solution, but it works...
mmalc
_______________________________________________
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.