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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:29:40+00:00 2026-06-02T05:29:40+00:00

I have a popover screen, with inside it : a label, that may or

  • 0

I have a popover screen, with inside it :

  • a label, that may or may not appear (title)
  • a search bar, that may or may not appear
  • a label, that may or may not appear, and has a variable height (help label)
  • a scrollview, that may or may not appear, and has a variable height (some infos about the following table)
  • a table view

In order to present something nice, in viewDidLoad, I move the various frames to place the objects correctly and not have unused spaces cluttering my popover. Besides, I then resize the table (to take the most place needed), and the popover via contentSizeInPopover (to avoid having a near-empty huge popover). All that resizing seems to work nicely, but I have one big problem : with all that resizing done, some cells of my UITableView become unresponsive. One or two cells, usually the second one, only respond if i tap in their outer corners, but the rest of the cell completely ignore any touches.

I’ve tried everything : moving all to viewWillAppear, letting the autoresize do its job (doesn’t seem to work either), but I still have this problem every time. I’ve found that if I comment the lines involved with changing the frame of the table, or the ones in contentSizeInPopover, the problem stops, but then my view is messed up, so this ins’t a fix.

If anyone could give me something to get out of this mess, that would be awesome.

- (CGFloat)getHeightWithoutTable {
    return LIST_TITLE_HEIGHT + (self.searchBar.hidden ? 0 : LIST_SEARCH_BAR_HEIGHT) + (self.helpLabel.hidden ? 0 : self.helpLabel.frame.size.height + LIST_STD_SPACE) + (self.errorScrollView.hidden ? 0 : self.errorScrollView.frame.size.height + LIST_STD_SPACE);
}

-(void)viewDidLoad {
    [super viewDidLoad];
    self.tableViewOutlet.backgroundView = nil;
    self.originData = [NSMutableArray array];
    self.searchedData = [NSMutableArray array];
    if (self.helper != nil) {
        CGFloat heightOffset = 0;
        // Content
        self.originData = [self.helper getData];
        self.tableData = [NSMutableArray arrayWithArray:self.originData];
        // Title
        NSString *title = [self.helper getPopoverTitle];
        if (title == nil) {
            self.popoverTitle.hidden = YES;
            heightOffset -= LIST_TITLE_HEIGHT;
        } else {
            self.popoverTitle.text = [self.helper getPopoverTitle];
        }
        // Search
        if ([self.originData count]  [self getStdHeight] / 3){
                self.helpLabel.lineBreakMode = UILineBreakModeTailTruncation;
                [self.helpLabel sizeThatFits:CGSizeMake(self.helpLabel.frame.size.width, [self getStdHeight] / 3)];
            }

            heightOffset += (self.helpLabel.frame.size.height - LIST_HELP_STD_HEIGHT);
        }
        // Errors
        if ([self.helper respondsToSelector:@selector(getErrors)]) {
            self.errors = [self.helper getErrors];
        }
        if (self.errors == nil || [self.errors count] == 0) {
            self.errorScrollView.hidden = YES;
            self.errorBg.hidden = YES;
            heightOffset -= LIST_ERROR_STD_HEIGHT + LIST_STD_SPACE;
        } else {
            [self createErrorView];
            heightOffset += (self.errorScrollView.frame.size.height - LIST_ERROR_STD_HEIGHT);
        }
        // Table
        CGFloat previewHeight = LIST_CELL_HEIGHT * [self.tableData count] + LIST_STD_SPACE;
        CGFloat remainingHeight = LIST_MAX_HEIGHT - [self getHeightWithoutTable] - LIST_STD_SPACE;
        CGFloat tableHeight = MIN(previewHeight, remainingHeight);
        CGRect tableFrame = self.tableViewOutlet.frame;
        self.tableViewOutlet.frame = CGRectMake(tableFrame.origin.x, tableFrame.origin.y + heightOffset, LIST_WIDTH, tableHeight);
        // Selected items
        if ([helper getSelectedObject] != nil){
            int index = [self.tableData indexOfObject:[helper getSelectedObject]];
            NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
            [self.tableViewOutlet scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
        }
    }
}

- (CGSize)contentSizeForViewInPopover {
    if (self.navigationController) {
        return CGSizeMake(LIST_WIDTH, LIST_MAX_HEIGHT);
    } else {
        CGFloat totalHeight = [self getHeightWithoutTable] + self.tableViewOutlet.frame.size.height + LIST_STD_SPACE;
        return CGSizeMake(LIST_WIDTH, totalHeight);
    }
}

(gist if you need some coloring to help you)

An image of the nib :

nib

  • 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-02T05:29:41+00:00Added an answer on June 2, 2026 at 5:29 am

    Found the answer myself : the fact I was using a self-filled UIScrollView next to my UITableView seemed to be the problem. As soon as I replaced the UIScrollView by a proper UITableView, the problem disappeared.

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

Sidebar

Related Questions

I have a control bar on my application that has popovers with dynamically loaded
I have a popover that contains a UITableView. This UITableView has a cell with
Recently I have taken interest in making a popover screen. In my Navigation bar
So I have a popover with a button in it. When that button is
I have a tableview inside a popover in my main view which is a
My problem is that: I have a popOver and when it is pop up
When using a UISplitViewController in portrait , I have a settings popover that I
I have a UITableview inside a popover. Initially the popover is displayed in portrait
I have a popover that gets loaded with a navigation controller, which displays the
I have a popover that accepts input into a UITextField. Depending on the input,

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.