• 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: Another FilteringController question for mmalc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another FilteringController question for mmalc


  • Subject: Re: Another FilteringController question for mmalc
  • From: J Nozzi <email@hidden>
  • Date: Fri, 17 Sep 2004 10:56:32 -0400


Never mind. ;-) It always helps to write out your problem and pose your question ... a short time after that you seem to come up with an answer of your own accord. Maybe I need to just hold off posting a question right away ... I might just answer it. ;-)


The answer might be a hack, but it certainly works beautifully. In mmalc's example, I modified the following method to include a conditional setSelectedIndex and it works fine:

- (void)search:(id)sender
{
    [self setSearchString:[sender stringValue]];
    [self rearrangeObjects];

    // Added the following to fix selection problem
    if ([[self arrangedObjects] count] == 1)
        [self setSelectionIndex:0];
}

 - J


On Sep 17, 2004, at 10:10 AM, J Nozzi wrote:

List / mmalc:

The Filtering Controller example on mmalc's Bindings page works well for filtering, however, I'm faced with a little side-effect that until now has stayed at the bottom of my list of issues to resolve (as I'm very early in this app's development). I wanted to get some suggestions for the best way of approaching a solution without the half-baked, ugly hack I'm likely to come up with to brutishly force the update. ;-)

The Problem:
I have a tableview that does not allow an empty selection with a textview to hold an entry's contents. When I search and there is only one result, it appears to be stuck. I create three 'entries' (Test 1, Test 2, and Test 3), and put in the 'contents' all "1 1 1 1" for test 1, "2 2 2 2" for test 2, etc. If I have "test 3" selected and search for "1", the textview goes blank, "test 1" is selected in the tableview, and clicking it doesn't bring up its contents in the textview.


  Any ideas?

 - J

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden

_______________________________________________ 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
  • Follow-Ups:
    • Re: Another FilteringController question for mmalc
      • From: J Nozzi <email@hidden>
References: 
 >Another FilteringController question for mmalc (From: J Nozzi <email@hidden>)

  • Prev by Date: Re: NSTableView and NSArrayController: modifying values does not change sort order
  • Next by Date: Re: OpenGL accumulator issue
  • Previous by thread: Another FilteringController question for mmalc
  • Next by thread: Re: Another FilteringController question for mmalc
  • Index(es):
    • Date
    • Thread