Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For UITableViewCell reuse issue if you are adding the UILabel, UIImageView, UITextField etc in UITableViewCell programmatically then follow the code given below.</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Cell"; UIImageView *img_view; UILabel *name_lbl; UILabel *date_lbl; UIImageView *status_imageview; UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; img_view=[[UIImageView alloc] initWithFrame:CGRectMake(OFFSET,OFFSET,IMAGEWIDTH,50)]; // Set Image view Properties img_view.tag = 101; [cell.contentView addSubview:pimg_view]; name_lbl= [[UILabel alloc] initWithFrame:CGRectMake(5*OFFSET+IMAGEWIDTH,5,200,25)]; //Set UILabel properties pname_lbl.tag = 202; [cell addSubview:name_lbl]; date_lbl= [[UILabel alloc] initWithFrame:CGRectMake(5*OFFSET+IMAGEWIDTH,30,200,25)]; date_lbl.tag = 303; [cell addSubview:date_lbl]; }else{ img_view = (UIImageView *)[(cell)viewWithTag:101]; name_lbl = (UILabel *)[(cell)viewWithTag:202]; date_lbl = (UILabel *)[(cell)viewWithTag:303]; } name_lbl.text = @"Set the Value accordingly"; date_lbl.text = @"Set the Value accordingly"; [img_view setImage:@"Set the image accordingly"]; cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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