Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding uitableview inside uitableviewcells issues?
    primarykey
    data
    text
    <p><img src="https://i.stack.imgur.com/fL2Na.jpg" alt="enter image description here">I have one iphone application in which i am adding uitableview inside uitableviewcell.in that each uitablecell contains tableview which has dynamic row based upon user's entry.i.e. tableview in first cell contains 3 rows.tableview in seconds row contains 4 row.thus it varies.my problem is that when i scroll the tableview then entries are repeated.how can i solve that?any tutorial or sample code?</p> <pre><code> -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath { if(tableView==self.tbView) { UITableView *tb; static NSString *CellIdentifier=@"CellIdentifier"; UITableViewCell *cell1=[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; int height; if(cell1==nil) { cell1=[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease]; tb=[[[UITableView alloc] initWithFrame:cell1.contentView.frame style:UITableViewStylePlain]autorelease]; tb.rowHeight=50; [cell1.contentView addSubview:tb]; NSMutableArray *a2=[[NSMutableArray alloc]init]; a2=[dateArray objectAtIndex:indexPath.row]; cntt=cntt+1; int no=[a2 count]+1; height=(no*50); heightcnt2=heightcnt2+1; NSLog(@"frame of tableviewcontentcell is %@",cell1.contentView.frame); tb.frame=CGRectMake(cell1.contentView.frame.origin.x,cell1.contentView.frame.origin.y,cell1.contentView.frame.size.width,height); tb.delegate=self; tb.dataSource=self; tb.tag=tag1; tb.scrollEnabled=NO; tag1=tag1+1; } return cell1; } else { static NSString *CellIdentifier2 = @"Cell"; CategoryListCustomCell *cell = (CategoryListCustomCell *)[[tableView dequeueReusableCellWithIdentifier:CellIdentifier2]autorelease]; if (cell == nil) { cell = [[[CategoryListCustomCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier2]autorelease]; } if(indexPath.row==0) { NSMutableArray *temp=[[NSMutableArray alloc]init]; int cmp=[dateArray count]; if(cnt&lt;=cmp-1) { temp=[dateArray objectAtIndex:cnt]; transationObj=[temp objectAtIndex:0]; } NSDate *date=transationObj.tran_date; NSDateFormatter *dateformatter=[[NSDateFormatter alloc]init]; [dateformatter setDateStyle:NSDateFormatterFullStyle]; NSString *strDate=[dateformatter stringFromDate:date]; cell.lblcatname.text=strDate; cnt=cnt+1; } else { transationObj=[[Transaction alloc]init]; NSMutableArray *temp2=[[NSMutableArray alloc]init]; int cmp2=[dateArray count]; if(cnt2&lt;cmp2-1) { temp2=[dateArray objectAtIndex:cnt2]; for(int i=0;i&lt;[temp2 count];i++) { transationObj=[temp2 objectAtIndex:i]; cell.lblcatname.text=transationObj.tran_des; } } cnt2=cnt2+1; } cell.backgroundColor=[UIColor grayColor]; return cell; } } </code></pre> <p>I want to create screen like shown in image.where each white section is not same size.its lengh is dynamic as per users entry.so is there any better approach then adding uitableview inside uitableview cell?</p>
    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.
 

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