• 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: Scott Little <email@hidden>
  • Date: Mon, 23 Feb 2004 20:15:00 +0100

This is what I did the other day to solve that problem, though it seemed to be a bit of a hack. I would be interested to know if anyone has a more elegant solution. The search: selector is set as the action for the field and is called when the value of the NSSearchField is changed (either continuously or when the user hits Enter depending on the settings of the field). This seemed to work in both cases, though I haven't done a lot of testing on it :-p

- (void)search:(id)sender {
[self rearrangeObjects];
if ([sender isKindOfClass:[NSSearchField class]]) {
NSWindow *myWindow = [NSApp keyWindow];
NSText *myEditor = [myWindow fieldEditor:NO forObject:sender];
NSRange savedRange = [myEditor selectedRange];
[myWindow makeFirstResponder:sender];
[myEditor setSelectedRange:savedRange];
}
}

Actually this also answers more clearly the question posed about getting the selection of a text field.

Scott Little
Netonomy  Empowering your customers through self-service

Tel: +336 14 48 65 20
Email: email@hidden

On 23 Feb, 2004, at 19:37, Francisco Tolmasky wrote:

This question has already been posted once, but with no avail. I'm having trouble filtering an nstableview with bindings. What happens is that the search field loses focus when the table view rearranges itself. Does anyone know a solution to this?

Also, does anyone know where i can get this example which now seems to be down:

http://homepage.mac.com/mmalc/CocoaExamples/FilteringController.zip

Francisco Tolmasky
email@hidden
http://users.adelphia.net/~ftolmasky
_______________________________________________
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.
_______________________________________________
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>)

  • Prev by Date: NSSearchField search template through IB
  • Next by Date: Re: Can't open specified type in NSOpenPanel
  • Previous by thread: Filtering tableview problems
  • Next by thread: Re: Filtering tableview problems
  • Index(es):
    • Date
    • Thread