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 9309171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:48:11+00:00 2026-06-19T00:48:11+00:00

For work purposes I need to create a UIScrollView which embeds a UIView which

  • 0

For work purposes I need to create a UIScrollView which embeds a UIView which in his turn embeds an UITableView via the container feature in Xcode.

My UIScrollView is a full page scrollview with Paging enabled.
My UIView is filled with a UIImage, some UIButton’s and a container linking to a UITableView.

On initial launch, the data is loaded perfectly, meaning the UITableView is filled with the data, the UIImage is filled, and the Buttons are placed correctly.

But for some strange reason the when I try to tap or scroll in the UITableView in the container all the data from my UITableView gets cleared.

I’m posting this question here, as I have not found any other similar issue on StackOverFlow or any other website.

UITableViewCode:

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.productTable setBackgroundView:nil];
    self.productTable.backgroundColor = [UIColor clearColor];
    self.productTable.delegate = self;
    self.productTable.dataSource = self;
}

- (void) viewDidAppear:(BOOL)animated {
    /*CGSize tmp = self.productTable.contentSize;
    self.productTable.frame = CGRectMake(0, 0, tmp.width, tmp.height * 3);*/


}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

    // Return the number of sections.
    NSLog(@"section count : %i", [self.Products count]);
    return [self.Products count];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    xcsSectionInfo *sectionInfo = [self.Products objectAtIndex:section];
    if (sectionInfo.isOpen == NO) {
        return 1;
    } else {
        return 3;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    xcsSectionInfo *sectionInfo = [self.Products objectAtIndex:indexPath.section];

    if (indexPath.row == 0)  {
        static NSString *CellIdentifier = @"Header";
        xcsProductHeaderCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
        cell.articleNumber.text = sectionInfo.product.articleNumber;
        cell.articleColor.text = sectionInfo.product.articleColor;
        cell.backgroundColor = [UIColor grayColor];
        if (sectionInfo.isOpen == YES && sectionInfo == self.currentSectionInfo) {
            cell.expandImage.image = [UIImage imageNamed:@"arrow_down.png"];
        } else if (sectionInfo.isOpen == NO) {
            cell.expandImage.image = [UIImage imageNamed:@"arrow_up.png"];
        }
        return cell;
    } else if (indexPath.row == 1) {
         static NSString *CellIdentifier = @"ProductHeader";
        xcsProductTitleCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
        cell.colorTempHeader.text = @"Color Temperature";
        cell.sourceQualityHeader.text = @"Source Quality";
        cell.sourceTypeHeader.text = @"Source Type";
        cell.luminaireFluxHeader.text = @"Luminaire Flux";
        cell.powerConsumptionHeader.text = @"Power Consumption";
        cell.luminaireEfficacyHeader.text = @"Luminaire Efficacy";
        cell.backgroundColor = [UIColor grayColor];
        return cell;
    } else if (indexPath.row == 2) {

        static NSString *CellIdentifier = @"Product";
        xcsProductCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
        cell.colorTemp.text = sectionInfo.product.colorTemperature;
        cell.sourceQuality.text = sectionInfo.product.sourceQuality;
        cell.sourceType.text = sectionInfo.product.sourceType;
        cell.luminaireFlux.text = sectionInfo.product.luminaireFlux;
        cell.powerConsumption.text = sectionInfo.product.powerConsumption;
        cell.luminaireEfficacy.text = sectionInfo.product.luminaireEfficacy;
        cell.backgroundColor = [UIColor grayColor];
        return cell;
    }
}

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
        xcsSectionInfo *sectionInfo = [self.Products objectAtIndex:indexPath.section];
    NSIndexPath *path0 = [NSIndexPath indexPathForRow:[indexPath row]+1 inSection:[indexPath section]];
    NSIndexPath *path1 = [NSIndexPath indexPathForRow:[indexPath row]+2 inSection:[indexPath section]];
            NSArray *indexPathArray = [NSArray arrayWithObjects: path0, path1, nil];
    if (sectionInfo.isOpen == NO) {
        sectionInfo.isOpen = YES;
        [tableView insertRowsAtIndexPaths:indexPathArray withRowAnimation:NO];
    } else {
        sectionInfo.isOpen = NO;
        [tableView deleteRowsAtIndexPaths:indexPathArray withRowAnimation:NO];
    }
    [self.Products replaceObjectAtIndex:indexPath.section withObject:sectionInfo];
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    self.currentSectionInfo = sectionInfo;
    [tableView reloadData];
}

Btw.: I’m using storyboards

Regards and thanks in advance.

  • 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-06-19T00:48:13+00:00Added an answer on June 19, 2026 at 12:48 am

    UPDATE 2:

    I think a UIPageViewController would be more appropriate (link‌​). It looks like it accomplishes what you are trying to achieve. And probably much more simple than managing scroll views embedded in other scroll views.


    UPDATE:

    It looks like what you are trying to achieve is made possible in the UIPageViewController (link). If this works, it would be better than trying to manage scroll views embedded in other views.


    Embedding a UITableView is specifically NOT recommended by Apple. Conflicts arise when the system is trying to figure out where to send events:

    Important: You should not embed UIWebView or UITableView objects in
    UIScrollView objects. If you do so, unexpected behavior can result
    because touch events for the two objects can be mixed up and wrongly
    handled.
    (source)

    But here is the stupid part, when you go to the source link, you will notice that appears in the docs for the UIWebView. Apple forgot to include it in the docs for UITableView.

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

Sidebar

Related Questions

I need to create a global object that will work and can be used
I need to create a backup of a SQL Server 2005 Database that's only
I am doing an mysql php application and I need to create a procedure
I would like to create my own database server for educational purposes. My problem
We need to create a web-based frontend for displaying some data. The problem is
I need a mock implementation of a class - for testing purposes - and
I have a table with some columns. For archive purposes I usually create second
I'm dealing with Bitmaps in my application and for some purposes I need to
I'm trying to create a script for CI/deployment purposes, but am having problems. Unfortunately,
I have a Typed DataSet DataTable which inherits TypedTableBase<T> , which in turn implements

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.