How to get values from a tableview only checkmark is the accessory view?
<p>I have a requirement that I want to select the multiple values from the cell, I am using chekmark as accessory type for tableview, if the user multiple select the tableview I want that value in a array and use in my button click for sharing function. This is my code for  multiple select accessory type.</p>

<pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    NSString *CellIdentifier;
    CellIdentifier=[NSString stringWithFormat:@"cell %d",indexPath.row];


    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];    
    if (cell == nil) {

        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
        cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
        cell.detailTextLabel.numberOfLines = 0;
        UIImageView* img = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bgCELL3@2X-1"]];
        [cell setBackgroundView:img];
        [img release];
        count++;
    }

    NSMutableString *str=[[NSMutableString alloc]initWithString:[appDelegate.indexArray objectAtIndex:indexPath.section]];
    cell.textLabel.text =str ; 
    cell.textLabel.font = [UIFont fontWithName:@"Georgia" size:14.0]; 
    cell.textLabel.textColor = [UIColor brownColor];

    NSMutableString *notes=[[NSMutableString alloc]initWithString:[appDelegate.notesArray objectAtIndex:indexPath.section]];
    cell.detailTextLabel.text =notes;
    cell.detailTextLabel.font = [UIFont fontWithName:@"Georgia" size:14.0]; 
     cell.detailTextLabel.textColor = [UIColor darkGrayColor];
    //textView.text=notes;

    [notes release];

    cell.backgroundColor=[UIColor clearColor];




    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];

    NSArray* toReload = [NSArray arrayWithObjects: indexPath, self.selectedIndexPath, nil];
    self.selectedIndexPath = indexPath;
    if ([[tableView cellForRowAtIndexPath:indexPath] accessoryType] == UITableViewCellAccessoryCheckmark){

        BOOL selected = [[appDelegate.notesArray objectAtIndex:[indexPath row]] boolValue];
        [appDelegate.notesArray replaceObjectAtIndex:[indexPath row] withObject:[NSNumber numberWithBool:!selected]];

        [[tableView cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryNone];
    }

    else {

        [[tableView cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryCheckmark];

    }

}
</code></pre>

<p>i think the above code is correct,but i want to share multiple value to the google doc.but the single value share to GDoc is successful i want to get the multiple selection value as array and pass it through button click.I tried it but no luck,this is my code for sharing notes to GDoc</p>

<pre><code>- (IBAction)doUpload:(id)sender
{
    NSMutableArray *rowsToBeDeleted = [[NSMutableArray alloc] init];
    NSMutableArray *indexPaths = [[NSMutableArray alloc] init];
    int index = 0;


    for (NSNumber *rowSelected in appDelegate.notesArray)
    {
        if ([rowSelected boolValue])
        {

            [rowsToBeDeleted addObject:[appDelegate.notesArray objectAtIndex:index]];
            NSUInteger pathSource[2] = {0, index};
            NSIndexPath *path = [NSIndexPath indexPathWithIndexes:pathSource length:2];

            [indexPaths addObject:path];
            UploadView *uploadview = (UploadView *)self.view;
            if (uploadview != nil)
            {
                [m_owner uploadString:path];
                //[self dismissModalViewControllerAnimated:YES];
            }


        }       
        index++;




}
}
</code></pre>

<p>I get this warning that <code>"InComplatble pointer types sending NSIndexPath to parameter of type NSString"</code>,but I changed the NSIndexpath to <code>NSString like this   NSString *path = [NSString indexPathWithIndexes:pathSource length:2];</code> instead of   <code>NSIndexPath *path = [NSIndexPath indexPathWithIndexes:pathSource length:2];</code>,but no luck.</p>

<p>What is the mistake I made in the above code?</p>
