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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:40:48+00:00 2026-05-26T15:40:48+00:00

I am using the scrollToRowAtIndexPath to center my tableview on the previously selected cell,

  • 0

I am using the scrollToRowAtIndexPath to center my tableview on the previously selected cell, however its crashing the app while testing on the phone but not on the emulator.

This is how I set it up

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    //Center previously selected cell to center of the screen
    [self.tableView reloadData];
    [self.tableView scrollToRowAtIndexPath:oldCheckedIndexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
} 

And this is the error its giving

 *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:]: section (0) beyond bounds (0).'
*** First throw call stack:
(0x31fe88bf 0x31d581e5 0x31fe87b9 0x31fe87db 0x32b6df1f 0x29bef 0x32ae26b5 0x32b3daf1 0x32afed21 0x32afea71 0x32afe78b 0x32afe4ff 0x32ab581b 0x32abafb9 0x3193aba7 0x3273be8d 0x31fbb2dd 0x31f3e4dd 0x31f3e3a5 0x3204afed 0x32ace743 0x34f5 0x2f70)
terminate called throwing an exception(gdb) 

The thing being is I set

[self.tableView reloadData];
        [self.tableView scrollToRowAtIndexPath:oldCheckedIndexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];

in a different method the application works fine but dose not scroll to the index position..
I dont know how to fix it.

UPdate New error when trying to delay scrollToRowAtIndexPath

2011-11-02 16:00:58.180 code[2303:707] -[VehicleResultViewController methodThatCallsScrollToRow]: unrecognized selector sent to instance 0x1f3410
2011-11-02 16:00:58.184 code[2303:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[VehicleResultViewController methodThatCallsScrollToRow]: unrecognized selector sent to instance 0x1f3410'
*** First throw call stack:
(0x31fe88bf 0x31d581e5 0x31febacb 0x31fea945 0x31f45680 0x35bef943 0x31fbca63 0x31fbc6c9 0x31fbb29f 0x31f3e4dd 0x31f3e3a5 0x3204afed 0x32ace743 0x34a9 0x2f24)
terminate called throwing an exception(gdb) 
  • 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-26T15:40:48+00:00Added an answer on May 26, 2026 at 3:40 pm

    You probably don’t need to reload data – just run your scrollToRowAtIndexPath after a delay:

    [self performSelector:@selector(methodThatCallsScrollToRow) withObject:nil afterDelay:2.5];

    Give the table a chance to load.

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

Sidebar

Related Questions

I am trying to use scrollToRowAtIndexPath on a tableView. I'm using the method below.
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I
i am using below code for auto scrolling UITableview - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
im using code as below [sampleListTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES]; [sampleListTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle]; [sampleListTableView
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using ASP.NET MVC there are situations (such as form submission) that may require a

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.