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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:19:26+00:00 2026-05-11T19:19:26+00:00

I display an UITableView, and from time to time, the first row appears at

  • 0

I display an UITableView, and from time to time, the first row appears at the bottom of the view.

There is nothing above the first row, and the empty space isn’t touchable.

So far, I’ve checked:

  • headerView of tableView : is empty
  • use plain UITableViewCells
  • check the rowHeight of the cells
  • check the frame of the cells
  • when the bug happens, there is no memory warning before
  • check the contentOffset of the table scroll view

This bug appears only on the iPhone, never on the simulator.

The screenshot shows on the left the correct tableview, and on the right the view with the bug. When doing the snapshot, I touched the screen so the scroll bar is visible.

Any idea in what direction I should look?

I just saw the contentSize of the tableView scrollView is wrong: I have 84 cells @ 67 pixels and 1 cell @ 57 pixels height: total should be 5685 but is 6005. (off by 320). Strange.

Stephan

alt text http://www.quicksnapper.com/files/5161/18374733084A0B3EA24D152.png

  • 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-11T19:19:27+00:00Added an answer on May 11, 2026 at 7:19 pm

    So I found the solution to my problem:

    Adding an NSLog(@””). This is weird.

    In my viewWillAppear, I have

      if (searchByCuisinier || searchByResto) {
        NSLog(@"Will set tableHeaderView");
        self.tableView.tableHeaderView = searchBar;
        if (searchByCuisinier) {
          searchBar.placeholder = @"Cuisinier";
        } else {
          searchBar.placeholder = @"Restaurant";
        }
        searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone;
        searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
        if ([filteredList count] == 0)
          [searchBar becomeFirstResponder];
      } else {
        self.tableView.tableHeaderView = nil;
        NSLog(@""); // Magic!
      }
    

    Adding the NSLog(@””) solves the bug.

    Also reversing the test:
    Instead of

      if (searchByCuisinier || searchByResto) {
    ....
    

    I do:

      if (!searchByCuisinier && !searchByResto) {
    ....
    

    I have absolutely no idea why this works (or why it doesnt work without the NSLog).

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

Sidebar

Related Questions

I need to tell a uitableview to reloadData when something happens on another view
Hi i received 2000 of datas from udp and display the values in tableview
I am navigating from tableview1.row to a tableview2 which has a LOT of rows
I have a UITableView with pagingEnabled. Each cell takes up the viewing area of
I have difficulties displaying objects coming from CoreData in a tableView. I have 2
If it is unclear what I mean from the headline, I am referring to
So I've transferred the core data code from Apple's sample Core Data / RSS
Hopefully I'll get some help here. Basic setup is this: My application swaps out
I am developing a location aware application with five tabs. In the application I

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.