Re: NSTableView questions (take 2)
Re: NSTableView questions (take 2)
- Subject: Re: NSTableView questions (take 2)
- From: Corbin Dunn <email@hidden>
- Date: Tue, 02 Feb 2010 09:26:41 -0800
Matthew -- I believe there was a problem with < 10.5 asserting; that has been fixed, but you have to link on 10.5+ to get the "fixed" behavior (for compatibility reasons). I suggest requiring your uses to upgrade :)
However, you should be able to do -setAllowsMultipleSelection:YES, select the rows, and then setAllowsMultipleSelection:NO
corbin
On Feb 2, 2010, at 9:18 AM, Matthew Weinstein wrote:
> So this is the rub: If I just set allowsMultipleSelection: NO in interface builder and don't set allowsMultipleSelection:YES [programmatically right before doing the setSelected... (though I have to support 10.2-?? so I am still using setSelectedRow...)] I get the following error:
>
> 2010-02-02 09:02:06.039 TAMSAnalyzer[30180:10b] *** Assertion failure in -[NSTableView selectRow:byExtendingSelection:], /SourceCache/AppKit/AppKit-949.54/TableView.subproj/NSTableView.m:9223
> 2010-02-02 09:02:06.040 TAMSAnalyzer[30180:10b] Invalid parameter not satisfying: !extend || _tvFlags.allowsMultipleSelection
> 2010-02-02 09:02:24.675 TAMSAnalyzer[30180:10b] *** Assertion failure in -[NSTableView selectRow:byExtendingSelection:], /SourceCache/AppKit/AppKit-949.54/TableView.subproj/NSTableView.m:9223
> 2010-02-02 09:02:24.675 TAMSAnalyzer[30180:10b] Invalid parameter not satisfying: !extend || _tvFlags.allowsMultipleSelection
>
>
> If I do programatically allow multiple selection in table B right before I do the setSelectedRow: byExtending...:YES; it seems to work fine. That is, until I click in Table B, there it's allowing multiple selections and I don't want it to.
>
> THE PROBLEM is when to turn off the allowMultipleSelection. I need to capture the mouse down when the user clicks in table B to forbid multiple selections (back to its default state).
>
> On Feb 2, 2010, at 9:08 AM, Corbin Dunn wrote:
>
>> Table b should be set to setAllowsMultipleSelection:NO. However, despite that, you can programmatically change the selection yourself with -setSelectedRowIndexes:byExtendingSelection: when the selection in Table A changes.
>>
>> --corbin
>>
>>> I have 2 tables that basically have a many to many relationship. If I click on table A I want multiple values of table B to be selected; but I click on table B I want to make sure I can't select multiple values
>>>
>>> On Feb 2, 2010, at 8:53 AM, Corbin Dunn wrote:
>>>
>>>>
>>>> On Feb 2, 2010, at 8:32 AM, Matthew Weinstein wrote:
>>>>
>>>>> Still trying to find a way to turn off setAllowsMultipleSelection just as the table becomes the responder. Is there some way of anticipating this, a "willbecomefirstresponder" kind of a notification?
>>>>
>>>> What are you really trying to do? Or, in other words, what is the goal with doing this?
>>>>
>>>> --corbin
>>>>
>>>
>
_______________________________________________
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