• 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
Complex Source List & Selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Complex Source List & Selection


  • Subject: Complex Source List & Selection
  • From: "I. Savant" <email@hidden>
  • Date: Thu, 27 Oct 2005 15:49:12 -0400

Hello

I'm building a custom view that acts as a source list for many different types of objects, all with different properties. For a number of reasons (custom drag-n-drop, different column counts & alignments, etc), my custom view contains an outline view and several different table views all using the datasource methods (no bindings). The view tiles nicely and displaying the information in this way is working fine.

My problem is that, being a source list, I want there to be only one selection. In other words, if one table/outline view is clicked and the selection changes, I want all *other* table/outline views to deselect any selection they may have.

To accomplish this, I used the delegate method tableView:shouldSelectRow: to call a custom method called selectionChangedForView: ...

- (void)selectionChangedForView:(id)view
{
    // Deselect everything else but view's selection
    if (view != viewA) // outline view
        [viewA selectRow:-1 byExtendingSelection:NO];
    if (view != viewB) // table view
        [viewB selectRow:-1 byExtendingSelection:NO];
    if (view != viewC) // table view
        [viewC selectRow:-1 byExtendingSelection:NO];
}

The problem is, even after stepping through this with the debugger, nothing happens - the selection does not change at all for any view no matter which view is clicked. It does react correctly depending on the view that is passed to the method ... it calls the selection line for every view, skipping the view it's told to.

A few points before anybody asks: Yes, the outlets are definitely connected because other visibly verifiable changes occur when talking to these views elsewhere (such as custom drawing code that depends on a 'setColor:' method being sent to the tables/outline). :-)

If I haven't explained something properly, please let me know what to elaborate. Any suggestions would be helpful ...

Thanks,

I.S.

_______________________________________________
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: Complex Source List & Selection
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: Re: Deployment build from Tiger not running on Panther
  • Next by Date: Re: Cocoa window initially hidden in IB?
  • Previous by thread: Re: CIFilter - can not change value
  • Next by thread: Re: Complex Source List & Selection
  • Index(es):
    • Date
    • Thread