Note that there are some explanatory texts on larger screens.

plurals
  1. POPush to another view with UIBarButtonSystemItemAdd
    primarykey
    data
    text
    <p>I am trying to edit the add button to push to another view. But I am receiving an error</p> <pre><code>-(void)locationAdd:(id)sender{ if([self.parentViewController isKindOfClass:[UINavigationController class]]){ UINavigationController *parent = (UINavigationController *)self.parentViewController; if ([[parent viewControllers] objectAtIndex:0] == self) { LocationsAddViewController *alocationAddViewController = [[[LocationsAddViewController alloc] initWithNibName:@"LocationAddView" bundle:[NSBundle mainBundle]] autorelease]; //self.locationAddViewController = alocationAddViewController; alocationAddViewController.title = @"Toevoegen"; [self.parentViewController pushViewController:alocationAddViewController animated:YES]; } else if([[parent viewControllers] objectAtIndex:2] == self){ LocationsAddViewController *alocationAddViewController = [[[LocationsAddViewController alloc] initWithNibName:@"LocationAddView" bundle:[NSBundle mainBundle]] autorelease]; alocationAddViewController.title = @"Toevoegen"; [self.parentViewController pushViewController:alocationAddViewController animated:YES]; } } } </code></pre> <p>Because the view can be reached from 2 other views and it has to look different, I have used </p> <pre><code>if([self.parentViewController isKindOfClass:[UINavigationController class]]){ UINavigationController *parent = (UINavigationController *)self.parentViewController; if ([[parent viewControllers] objectAtIndex:0] == self) { </code></pre> <p>to check where it comes from.</p> <p>The problem is at: [self.parentViewController pushViewController:alocationAddViewController animated:YES]; I am receiving the error:</p> <p>+[LocationsTableViewController pushViewController:animated:]: unrecognized selector sent to class 0x23510 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[LocationsTableViewController pushViewController:animated:]: unrecognized selector sent to class 0x23510'</p> <p>Can someone help me? What did I do wrong?</p>
    singulars
    1. This table or related slice is empty.
    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.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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