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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:03:03+00:00 2026-05-23T17:03:03+00:00

I have a UITableViewController and want to move down a cell in my table

  • 0

I have a UITableViewController and want to move down a cell in my table every time the accelerometer’s X axis is greater then 0.5 (when this event occurs i increment a value named “TEST” ). How can i change the background of a cell that has it’s indexPath.row equal to TEST ?

Here is how i try to access the method(from the accelerometer function) but it gives me an error :

  - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration 
{


              if(acceleration.x>0.5)
                TEST++; 
            if(TEST<0) TEST=0;
            if(TEST>19) TEST=19;

             NSIndexPath *temp = [[NSIndexPath alloc] initWithIndex:TEST];
            [self tableView:[self tableView] didSelectRowAtIndexPath:temp];


    }

     I have 20 rows in my table (hence the clamp).
  • 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-23T17:03:04+00:00Added an answer on May 23, 2026 at 5:03 pm

    selectRowAtIndexPath:animated:scrollPosition:

    Selects a row in the receiver identified by index path, optionally scrolling the row to a location in the receiver.

    • (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition

    Parameters

    indexPath

    An index path identifying a row in the receiver.

    animated
    YES if you want to animate the selection and any change in position, NO if the change should be immediate.

    scrollPosition

    A constant that identifies a relative position in the receiving table view (top, middle, bottom) for the row when scrolling concludes. See “Table View Scroll Position”

    here

                NSIndexPath *temp = [[NSIndexPath alloc] initWithIndex:TEST];
    
    
           [self.tableview selectRowAtIndexPath:temp animated:YES scrollPosition:UITableViewScrollPositionNone];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITableViewController that when a cell is pressed, I want the controller
I have a UITableViewController. When I click on a cell I want to push
I have a UITableViewController and I want to extend the tableHeaderView of that table
I have a UIPickerView as subview in a UITableViewController, which I want to slide
I have a structure like this.... UITableViewController -> UITableViewCell -> UIView I need the
I am using a UITableViewController which uploads a table. I have a Nib File
I have a UITableViewController that contains a tableView. I want to set its scrollView
I have a Nib file containing grouped table view and a cell. The cell
I have several UITableViewController s. I want to use one of those controllers as
I have a UITableViewController, which is RootViewController. It's XIB only has a table view.

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.