Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6474921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:38:40+00:00 2026-05-25T06:38:40+00:00

I have one iphone application in which i am adding uitableview inside uitableviewcell.in that

  • 0

enter image description hereI 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?

 -(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<=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<cmp2-1)
            {
                temp2=[dateArray objectAtIndex:cnt2];
                for(int i=0;i<[temp2 count];i++)
                {
                    transationObj=[temp2 objectAtIndex:i];
                    cell.lblcatname.text=transationObj.tran_des;

                }



            }
            cnt2=cnt2+1;


        }

        cell.backgroundColor=[UIColor grayColor];
               return cell;

    }




}

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:38:40+00:00Added an answer on May 25, 2026 at 6:38 am

    I have solved the issue by using

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

    instead of
    static NSString *CellIdentifier=@"CellIdentifier"; in first tableview
    but i know that this will make uitableview to scroll slowly as it is nor reusing CellIdentifier.so it any one can give better solution or better way to make uitableview nested i would appreciate it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HEllo, I have a hybrid iPhone application that has a UITabBarController and 5 Tabs.
I have an iPhone application with Tabbar. One of the tabs is UIWebView which
I have a UITableView in an iPhone application which I am refreshing (by calling
I have a very simple scenario: My iPhone application contains a UIViewController implementation which
I am developing an iPhone application which has a lot of different cards, each
i have one application in iphone in which i have to show notification when
I have an iPhone application which has some methods to gather information from the
I am working on an iPhone application that has a UISearchBar which populates a
I have one iphone application in which recurring events happens.the duration are like every
I am developing native iPhone app. I have one requirement that, there are 5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.