0

I've got a nav controller that moves between two tableviews. The first table view has a right detail text label, like the settings app, that I'd like to display the selected options (allows multiple selections). Unfortunately, im having trouble figuring out how to do this...

I'm trying to use the indexPathsForSelectedRows method to send the index paths back to the parent VC, but unfortunately I can't figure out how to use those index paths to isolate the selected options.

Is there a way I can query an array for objects at the indexes corresponding to the array of index paths? I would like to use the objectsAtIndexes: method on my data array, but I can't figure out how to create an indexSet out of indexPathsForSelectedRows. Anyone know how to do this?

Sean Danzeiser
  • 8,731
  • 12
  • 49
  • 84

1 Answers1

0

Typically, I either have the model objects themselves know if they are selected, or more commonly, have an array that references all of the selected items. So when you select a row, it adds it to the array (or removes it if getting deselected). Then you can pass this array back.

Christian
  • 1,714
  • 8
  • 9
  • Ya i think that would work, but for my project I have multiple selection fields, so somehow i'd need to link those arrays to the particular row that was selected in the parent view controller. Not totally sure how to do that . . . – Sean Danzeiser Jun 18 '12 at 18:50