• 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: Two NSTableViews acting as one
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two NSTableViews acting as one


  • Subject: Re: Two NSTableViews acting as one
  • From: The Karl Adam <email@hidden>
  • Date: Wed, 2 Nov 2005 17:23:24 -0500

Well another approach you could take is to write a value transformer
that merely took the selectionIndex and through some logic on your
part would caclculate the selected row. ie. top tableview could have
16 items and you'd use counts greater than 16 to set no selection on
the first tableview and n-16 on the second table view.

This of course assumes you have the table views arranged one on top of
the each so that this makes some sense.

-Karl

On 11/2/05, Jason Bell <email@hidden> wrote:
> This keeps the selectionIndexes synchronized between the tables.
> Selecting row two in the first table automatically selects row two in
> the second table.  This is unfortunately not what I'm after.  One and
> only one row should be selected from "the list" which is made up of
> the two tables.  It should appear as though it's just one table view
> with "allows empty selection" unchecked.
>
> - Jason
>
>
> On Nov 2, 2005, at 2:52 PM, The Karl Adam wrote:
>
> > Bind selectionIndexes of both tableViews to the arrayController's
> > selectionIndexes. Now your selections will be seamless across both
> > tables at all times.
> >
> > -Karl
> >
> > On 11/2/05, Jason Bell <email@hidden> wrote:
> >> In the UI for the next release of my app, I have a space that appears
> >> to be one list of items.  However, it is actually a fixed list
> >> followed by a separator bar and then a dynamic list (similar to the
> >> left side of the finder).  I implemented this using two NSTableViews,
> >> each bound to an array controller.  The problem is that even though
> >> they are two separate table views, they need to behave together like
> >> one table view that does not allow a multiple or empty selection.  I
> >> got most of the way there using a combination of
> >> selectionShouldChangeInTableView, tableViewSelectionDidChange, and
> >> some toggling of setAllowsEmptySelection.  However, there always
> >> seems to be a way to trip it up and get to a point where nothing
> >> appears selected or something appears as selected in both lists.
> >>
> >> I'm stating to think there might be a cleaner way to accomplish this
> >> goal.  I'm relatively new to bindings so perhaps I'm making things
> >> overly difficult in how I am using my table view delegate to change
> >> the current selection in the array controllers.  Not necessarily some
> >> code but any thoughts about a different way to approach this would be
> >> much appreciated.
> >>
> >> Thanks,
> >> Jason
> >>
> >>  _______________________________________________
> >> Do not post admin requests to the list. They will be ignored.
> >> Cocoa-dev mailing list      (email@hidden)
> >> Help/Unsubscribe/Update your Subscription:
> >> 40gmail.com
> >>
> >> 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: [SOLVED] Two NSTableViews acting as one
      • From: Jason Bell <email@hidden>
References: 
 >Two NSTableViews acting as one (From: Jason Bell <email@hidden>)
 >Re: Two NSTableViews acting as one (From: The Karl Adam <email@hidden>)
 >Re: Two NSTableViews acting as one (From: Jason Bell <email@hidden>)

  • Prev by Date: NSOpenPanel and showing file name's
  • Next by Date: Re: NSOpenPanel and showing file name's
  • Previous by thread: Re: Two NSTableViews acting as one
  • Next by thread: Re: [SOLVED] Two NSTableViews acting as one
  • Index(es):
    • Date
    • Thread