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

  • Home
  • SEARCH
  • 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 84905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:00:19+00:00 2026-05-10T22:00:19+00:00

In an app I’m working on, I have a plain style UITableView that can

  • 0

In an app I’m working on, I have a plain style UITableView that can contain a section containing zero rows. I want to be able to scroll to this section using scrollToRowAtIndexPath:atScrollPosition:animated: but I get an error when I try to scroll to this section due to the lack of child rows.

Apple’s calendar application is able to do this, if you look at your calendar in list view, and there are no events in your calendar for today, an empty section is inserted for today and you can scroll to it using the Today button in the toolbar at the bottom of the screen. As far as I can tell Apple may be using a customized UITableView, or they’re using a private API…

The only workaround I can think of is to insert an empty UITableCell in that’s 0 pixels high and scroll to that. But it’s my understanding that having cells of varying heights is really bad for scrolling performance. Still I’ll try it anyway, maybe the performance hit won’t be too bad.

Update

Since there seems to be no solution to this, I’ve filed a bug report with apple. If this affects you too, file a duplicate of rdar://problem/6263339 (Open Radar link) if you want this to get this fixed faster.

Update #2

I have a decent workaround to this issue, take a look at my answer below.

  • 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. 2026-05-10T22:00:19+00:00Added an answer on May 10, 2026 at 10:00 pm

    UPDATE: Looks like this bug is fixed in iOS 3.0. You can use the following NSIndexPath to scroll to a section containing 0 rows:

    [NSIndexPath indexPathForRow:NSNotFound inSection:section] 

    I’ll leave my original workaround here for anyone still maintaining a project using the 2.x SDK.


    Found a decent workaround:

    CGRect sectionRect = [tableView rectForSection:indexOfSectionToScrollTo]; [tableView scrollRectToVisible:sectionRect animated:YES]; 

    The code above will scroll the tableview so the desired section is visible but not necessarily at the top or bottom of the visible area. If you want to scroll so the section is at the top do this:

    CGRect sectionRect = [tableView rectForSection:indexOfSectionToScrollTo]; sectionRect.size.height = tableView.frame.size.height; [tableView scrollRectToVisible:sectionRect animated:YES]; 

    Modify sectionRect as desired to scroll the desired section to the bottom or middle of the visible area.

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

Sidebar

Related Questions

My app allows user to reorder rows in a table view, but I want
I have a new web app that is packaged as a WAR as part
My app is installed via NSIS. I want the installer to install the program
App Description: I have a UIWebview and a Toolbar beneath it. A button on
App Engine Datastore cannot be queried for an aggregate result. Example: I have an
Cocoa app, SnowLeopard I have a WebView in to which I'm loading HTML (essentially
App Store We have been developing an app for quite some time now for
app.get('/',function(req,res){ res.render('home'); // I want the template to be able to access the flash
My app has many controls on its surface, and more are added dynamically at
An app I'm writing always crashes on a clients computer, but I don't get

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.