Place a progress view in tableview cell based on cell index
<p>I am new to iphone.I have a small question that is,I have a class CustomCell in that i have declare all elements which i have required like the below</p>

<pre><code>// CustomCell.h
</code></pre>

<p>here in this class i am setting the getter and setter methods to TitleLabel, PercentageLabel, ProgressView, downloadButton</p>

<pre><code>//  CustomCell.m
</code></pre>

<p>here in this class set the frame to above all,and set the image to the download button also here </p>

<p>screen shot of my output screen is <img src="http://i.stack.imgur.com/sESxN.png" alt="the image which is in simulator is my output screen"></p>

<p>//  In my table view i have a download button when we click that the following method will executes</p>

<pre><code>-(void)downloadButtonClicked:(id)sender
{
    NSLog(@"download button clicked");
    int index = [sender tag];
    NSLog(@"index of the cell is %d",index);
    UIButton *button = (UIButton*)sender;

    UITableViewCell *cell = (UITableViewCell *)[[button superview] superview];

    UILabel *titleLabel = (UILabel *)[cell viewWithTag:100];

    NSLog(@"label text =%@",titleLabel.text);

    UIView *senderButton = (UIView*) sender;
    NSIndexPath *indexPath = [tableView indexPathForCell: (UITableViewCell*)[[senderButton superview]superview]]; 
    NSLog(@"indexpath is %d",indexPath.row);

    CustomCell *customCell = [[CustomCell alloc]init];
    progressView = [[UIProgressView alloc]init];
   // [customCell.contentView insertSubview:progressView atIndex:indexPath.row];
    [customCell.contentView addSubview:progressView];

    selectedBookTitle = titleLabel.text;

    NSString* documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];


    NSMutableArray *allDownloadLinks;
    biblePlayerViewController = [[BiblePlayerViewController alloc]init]; 
    allDownloadLinks = [biblePlayerViewController allDownloadLinks];
    NSLog(@"all Download Links are %@",allDownloadLinks);

    biblePlayerViewController.indexOfSelectedBookTitle = [[appDelegate getBookNames]indexOfObject:selectedBookTitle];

    Download* download = [Download downloadWithTitle:selectedBookTitle url:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.audiotreasure.com/%@.zip",[allDownloadLinks objectAtIndex:(biblePlayerViewController.indexOfSelectedBookTitle)]]]PathtoSave:documentsPath];
    [[DownloadManager sharedDownloadManager] queueDownload: download];


}
</code></pre>

<p>//  In cellForRowAtIndexPath tableview delegate method I have written code like this</p>

<pre><code>- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    CustomCell *cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) 
    {
        cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];

    }    
    NSLog(@"indexpath.row is %d",indexPath.row);
    NSLog(@"downloadmanager is %d",[[[DownloadManager sharedDownloadManager]getDownloads]count]);
  /*  if (indexPath.row&lt;[[[DownloadManager sharedDownloadManager] getDownloads]count]) 
    {
        cell.TitleLabel.text = ((Download*)[[[DownloadManager sharedDownloadManager] getDownloads] objectAtIndex:indexPath.row]).title_;    
        cell.ProgressView.progress = (float)(((Download*)[[[DownloadManager sharedDownloadManager] getDownloads] objectAtIndex:indexPath.row]).PercentageDownloaded_ )/100.0f;
        cell.PercentageLabel.text = [NSString stringWithFormat:@"%d %%",((Download*)[[[DownloadManager sharedDownloadManager] getDownloads] objectAtIndex:indexPath.row]).PercentageDownloaded_];     
    }
    else
    {
        [tableView reloadData];
    }*/
    NSString *titleLabel = [[appDelegate getBookNames]objectAtIndex:indexPath.row];
    cell.TitleLabel.text = titleLabel;
    cell.downloadButton.tag = indexPath.row;
    NSLog(@"tag is %d",cell.downloadButton.tag);
  [cell.downloadButton addTarget:self action:@selector(downloadButtonClicked:) forControlEvents:UIControlEventTouchUpInside];

    return cell;
}
</code></pre>

<p>My question is I have 66 cells in tableview in screen shot we have a bookname called Revelation.It has a 66th cell in my tableview (index is 65).Here when i click the download button in that cell,I have to show progress view in that particular cell only (65th cell).I have reload the table view for every 1 sec also because after placing the progress view we have to show the progress in that progress view in that cell.So, how can we place a progress view in that particular cell index.</p>
