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

The Archive Base Latest Questions

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

Simple question (yeah right!). I want to add a NEXT button on the detail

  • 0

Simple question (yeah right!). I want to add a “NEXT” button on the detail pages of my UISplitViewController for my iPad project. If clicked, it would be another way of advancing to the next page in the list of pages. As a bonus, I want to highlight the correct row that in the root view that corresponds with the new view you land on.

Any general guidance and suggestions on where to go would be AWESOME!

UPDATE: Thanks to Anna’s Suggestion below, here is the code I used to pull all this together. IT WORKS GREAT. Thanks Anna.

On the details page I included this:

- (IBAction)goToNext{
    NSLog(@"Going to Next from Welcome");
    [[NSNotificationCenter defaultCenter]
     postNotificationName:@"NextPageRequested" object:nil];

}

On the RootViewController page I did:

- (void)viewDidLoad {
    [super viewDidLoad];
    [[NSNotificationCenter defaultCenter]
     addObserver:self selector:@selector(moveOnToNextPage:)
     name:@"NextPageRequested" object:nil];
}

And Finally later in the RootViewController:

#pragma mark -
#pragma mark The NEXT Button
// This is the Code used for the Big NEXT button.  basically a Notification Center listener is set up in the view did load and when triggered by any of the buttons, this 
// function is called.  Here, I do 3 things:  1.  advance the highlighted cell of the master table view.  2.  call the didSelectRowAtIndexPath function of the table to 
// advance to the next page.  and 3.  Exchange the "dash" icon with the "check" icon.


-(void)moveOnToNextPage:(NSNotification*)notifications {
    NSIndexPath*    selection = [self.tableView indexPathForSelectedRow]; // grab the row path of the currently highlighted item



// Change the icon in the current row:

    NSString *checkImage = [[NSBundle mainBundle] pathForResource:@"checkGreen" ofType:@"png"];
    UIImage *checkMark = [[[UIImage alloc] initWithContentsOfFile:checkImage] autorelease]; // Grab the checkmark image.
    if (selection) {
        NSLog(@"not nil");
        UITableViewCell *cell1 = [self.tableView cellForRowAtIndexPath:[self.tableView indexPathForSelectedRow]];
        // cell1.accessoryType = UITableViewCellAccessoryCheckmark; // this is yet another way to add the checkmar, but for now, I will use Mine.
        cell1.imageView.image = checkMark; // now set the icon
    } else {
        NSLog(@"must be nil");
        NSUInteger indexArrBlank[] = {0,0}; // now throw this back into the integer set
        NSIndexPath *blankSet = [NSIndexPath indexPathWithIndexes:indexArrBlank length:2]; // create a new index path 
        UITableViewCell *cell0 = [self.tableView cellForRowAtIndexPath:blankSet];
        // cell1.accessoryType = UITableViewCellAccessoryCheckmark; // this is yet another way to add the checkmar, but for now, I will use Mine.
        cell0.imageView.image = checkMark; // now set the icon
    }



// Highlight the new Row
    int nextSelection = selection.row +1; // grab the int value of the row (cuz it actually has both the section and the row {section, row}) and add 1
    NSUInteger indexArr[] = {0,nextSelection}; // now throw this back into the integer set
    NSIndexPath *indexSet = [NSIndexPath indexPathWithIndexes:indexArr length:2]; // create a new index path 
    [self.tableView selectRowAtIndexPath:indexSet animated:YES scrollPosition:UITableViewScrollPositionTop]; // tell the table to highlight the new row

// Move to the new View
    UITableView *newTableView = self.tableView; // create a pointer to a new table View
    [self tableView:newTableView didSelectRowAtIndexPath:indexSet]; // call the didSelectRowAtIndexPath function
    //[newTableView autorelease];  //let the new tableView go.  ok.  this crashes it, so no releasing for now.

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

    One way to implement this is using NSNotificationCenter.

    The root view controller, in viewDidLoad, would call addObserver:selector:name:object: to make itself an observer for a notification named, say, @”NextPageRequested”.

    The button(s) on the detail view(s), when tapped, would call postNotificationName:object: to request the root view controller to go to the next page.

    In the root view controller, the notification handler method would (assuming the root view controller is a UITableView):

    • get the current index path using UITableView’s indexPathForSelectedRow
    • calculate the next index path
    • call selectRowAtIndexPath:animated:scrollPosition: to highlight that row
    • call the code needed to actually change the page (possibly by calling tableView:didSelectRowAtIndexPath: directly)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Simple question, I just want to select the text from the <Template> tag. Here's
simple question maybe but can't find solution. I have button for refresh/update some contents
Simple question, but I didn't know what's the keywords to Google. Suppose we want
yeah :( simple question * blush * Lets imagine i have the following enumeration:-
Simple question - I've got a bucketload of cruddy html pages to clean up
Simple question here: is there any way to convert from a jagged array to
Simple question... How am I going to reproduce Javascript bugs if I don't have
Simple question, the answer may not be... I'm going to be developing a web
Simple question - what does this actually do? var oq = (ObjectQuery<TEntity>)L2EQuery; return ExecuteFirstorDefault<TEntity>(oq,
simple question really, i was wanting to know what naming conventions anybody puts on

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.