title: Get Checkmark rows in UITableView in iOS
body: <p>I have checked some rows programatically at cellForRowAtIndexPath, and it is showing and working fine. But now I need to fetch the check marked rows. I use the following code:</p>
  
  <pre><code>for (int i=0; i&lt;10; i++) {
  
      NSIndexPath *index = [NSIndexPath indexPathForRow:i inSection:0];
  
      if([motorwayTable cellForRowAtIndexPath:index].accessoryType == UITableViewCellAccessoryCheckmark)
      {
          NSLog(@"Selected Rows: %d",i);
      }
  }
  </code></pre>
  
  <p>And here is my cellForRowAtIndexPath method:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
  static NSString *CellIdentifier = @"Cell";
  
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  if (cell == nil) {
      cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
      //cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
  }
  
  
  cell.textLabel.text = [NSString stringWithFormat:@"arefin %d",[indexPath row]];
  
  if(indexPath.row == 8 || indexPath.row == 7 || indexPath.row == 9)
  {
      cell.accessoryType = UITableViewCellAccessoryCheckmark;
      cell.selected = YES;
  }
  else
  {
      cell.accessoryType = UITableViewCellAccessoryNone;
  
  }
  
  [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  
  return cell;
  </code></pre>
  
  <p>}</p>
  
  <p>But the problem is I am getting only visible check marked rows, not getting that are not visible yet. How I can get check marked rows that are not visible yet in UITableView but checked programatically in cellForRowAtIndexPath.</p>
  
  <p>Thanks in Advance!</p>