Note that there are some explanatory texts on larger screens.

plurals
  1. POcall didSelectRowAtIndexPath on button click from DetailView on iPad
    primarykey
    data
    text
    <p>I am making an iPad SplitView App where I have the MasterView table on the left(in landscape orientation) and the DetailView on the right(nothing new so far...). When I click on a table cell, the detailView shows the cell details. I got also a button on the detialView to move forward to the next cell and a button to move backward to the previous cell. </p> <p>My problem is that I would like to change the cell selection in the table view on the left every time I click on a button so the user knows on which cell he currently is.</p> <p>I tried by calling the tableView: didSelectRowAtIndexPath: method but I can't seem to set the NSIndexPath right(I want to send an integer to indicate the number of the next cell).</p> <p>Here is the code that's trzing to call the selectRowAtIndexPath: method:</p> <p>iPadHelloWorldAppDelegate is the AppDelegate. masterViewController is the master controller with the table on it.</p> <pre><code>// method to set the image for the previous letter -(IBAction)previousLetter{ iPadHelloWorldAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; NSLog(@"IndexOfImage equals: %@", appDelegate.indexOfImage); int number = [[appDelegate.indexOfImage substringFromIndex:5] intValue]; NSString *imageName = [NSString stringWithFormat:@"image%@.png",[NSString stringWithFormat:@"%d", number-1]]; [self.letterImageView setImage:[UIImage imageNamed:imageName]]; NSLog(@"Image name: %@", imageName); appDelegate.indexOfImage = [imageName substringToIndex:6]; NSIndexPath *currentPath = appDelegate.currentPath; NSIndexPath *nextPath = [NSIndexPath indexPathForRow:currentPath.row-1 inSection:currentPath.section]; [masterViewController.tableView selectRowAtIndexPath:nextPath animated:YES scrollPosition:UITableViewScrollPositionNone]; NSLog(@"currentPath: %@", currentPath); appDelegate.currentPath = nextPath; NSLog(@"nextPath: %@", nextPath); </code></pre> <p>Please help...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload