Re: 2 outline views, selection changes
Re: 2 outline views, selection changes
- Subject: Re: 2 outline views, selection changes
- From: Keary Suska <email@hidden>
- Date: Sat, 02 Aug 2008 14:01:22 -0600
- Thread-topic: 2 outline views, selection changes
8/1/08 8:08 PM, also sprach email@hidden:
> I've been wracking my brain over this and after having too much
> caffeine and little results ...
>
> I have 2 outline views and I'd like to have them operate such that
> selecting an item in OV#1, deselects any item(s) in OV#2 and vice versa.
>
> I have tried many things in
>
> - (void)outlineViewSelectionDidChange:(NSNotification *)notification
>
> and in
>
> - (void)outlineViewSelectionIsChanging:(NSNotification *)notification
>
> however, when I try adjusting the selection in one view, it causes a
> loop where both end up having nothing selected.
Off the top of my head, and keeping your current approach, you can check for
a selection in the other OV before attempting to clear the selection of
itself. I.e.:
1. User clicks in OV#1
2. OV#2 delegate receives -outlineViewSelectionDidChange:; checks to see if
OV#1 has a selection, if so, clears OV#2's selection.
3. Clear action of OV#2 causes OV#1's delegate to receive
-outlineViewSelectionDidChange:; checks to see if OV#2 has a selection,
which it shouldn't since it has just been cleared, so does nothing.
This should be properly reversible (i.e. should work equally if you swap #2
for #1 in the above).
Alternatively, you could implement the "clear" operation in an action method
invoked by the OV (don't forget to check -clickedRow).
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden