• 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: Filtering tableview problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Filtering tableview problems (From: Francisco Tolmasky <email@hidden>)
 >Re: Filtering tableview problems (From: Scott Anguish <email@hidden>)
 >Re: Filtering tableview problems (From: Scott Anguish <email@hidden>)

  • Prev by Date: key value observing stops
  • Next by Date: Re: sheet not attaching to parent?
  • Previous by thread: Re: Filtering tableview problems
  • Next by thread: NSSearchField search template through IB
  • Index(es):
    • Date
    • Thread