Note that there are some explanatory texts on larger screens.

plurals
  1. POwhen we click on a button in tableview cell how to retrieve the text in the label of that particular cell
    primarykey
    data
    text
    <p>I am new to iphone.I have a small doubt (i.e),I have create a table view in that i am placing all my book names and download option to that particular book in each cell like as below</p> <pre><code>Genesis Download Exodus Download Leviticus Download </code></pre> <p>Here is the above Genesis,Exodus,Leviticus are booknames and download is the button for download that book like this i have 66 different books in table view.Here my question is when we click on download button i want to get the corresponding bookname of that tableview cell. My code is like below</p> <pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 66; } - (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UIButton *downloadButton = nil; //this is the custom cell i have created one class for this in that i am place the string titlelabel. CustomCell *cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; downloadButton = [UIButton buttonWithType:UIButtonTypeCustom]; downloadButton.frame = CGRectMake(220,10,50,30); [downloadButton setImage:[UIImage imageNamed:@"download.png"] forState:UIControlStateNormal]; [downloadButton addTarget:self action:@selector(downloadButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; downloadButton.backgroundColor = [UIColor clearColor]; downloadButton.userInteractionEnabled = YES; downloadButton.highlighted = YES; [cell.contentView addSubview:downloadButton]; } NSString *titleLabel = [[appDelegate getBookNames]objectAtIndex:indexPath.row]; cell.TitleLabel.text = titleLabel; return cell; } -(void)downloadButtonClicked:(id)sender{ } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload