Jonathan
Jonathan

Reputation: 11

How to know how many rows and columns are selected in a NSMatrix?

How to know how many rows and columns are selected in a NSMatrix ? I tried many things but it does not work.

I thought about first getting the selected cells by calling selectedCells method of NSMatrix but then I don't know what to do. I should save somewhere in each cell instance its position (row/col) inside the NSMatrix? Is there another solution?

Upvotes: 1

Views: 296

Answers (1)

edc1591
edc1591

Reputation: 10182

You can find out how many are selected by doing this:

NSArray *selectedArray = [myMatrix selectedCells];
NSUInteger selectedNum = [selectedArray count];

Where myMatrix is your NSMatrix instance.

Upvotes: 1

Related Questions