0

1st part-->I need to select multiple rows from UITableView and when the users has selected the rows as per his requirements,then he will click the Done button to complete the selecting process. 2nd part-->Then i need to display all selected rows in seperate UIViewController.

The thing which I already did is that I displayed data on my UITableView and now I want to display selected rows in seperate ViewController. So any help will be appreciated.

Nilesh Kumar
  • 2,141
  • 3
  • 16
  • 20

1 Answers1

0

This can be done as follows:

  1. keep a mutable array in which add the object from the datasource of your current tableview every time the user selects a row. (i am curious though, how are you determining whether the user has selected a row?)

  2. use this mutable array as the datasource for the next tableview where you wish to show the selected tables.

Hope that helps...

Aish
  • 189
  • 7
  • - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"selected #%d row",indexPath.row); }------>through this i will determine whether the user has selected a row. – Nilesh Kumar Feb 03 '14 at 12:25
  • yeah well keep a check too in case the user wants to uncheck... :) did you try this?? did it work out?? – Aish Feb 03 '14 at 12:26
  • ok that's a good point.I was trying things functionality,but forgotten about uncheck preocess......Thanks – Nilesh Kumar Feb 03 '14 at 12:29
  • happy to help... by the way if the solution worked out for you... please upvote my answer... :) – Aish Feb 03 '14 at 12:39