Unrecognized selector sent to instance while trying to open apple maps app in my app
<p>I am trying to open up apple maps within the map that I created, and in the process of doing so I am getting an error saying that "unrecognized selector send to instance". I am using arc so there should be no memory management problem. Here is the code I wrote in viewDidLoad. I created a button and added a selector to it..</p>

<pre><code>UIButton *appleMapsButton = [[UIButton alloc] init];
appleMapsButton.frame = CGRectMake(100, 100, 200, 200);
appleMapsButton.backgroundColor = [UIColor redColor];
[appleMapsButton addTarget:self action:@selector(appleMapsClicked:) forControlEvents:UIControlEventTouchUpInside];
[mapView addSubview:appleMapsButton];
</code></pre>

<p>Here is the action method:</p>

<pre><code>-(void)appleMapsClicked{

CLLocationCoordinate2D endingCoord = CLLocationCoordinate2DMake(lat, lng);
MKPlacemark *endLocation = [[MKPlacemark alloc] initWithCoordinate:endingCoord addressDictionary:nil];
MKMapItem *endingItem = [[MKMapItem alloc] initWithPlacemark:endLocation];

NSMutableDictionary *launchOptions = [[NSMutableDictionary alloc] init];
[launchOptions setObject:MKLaunchOptionsDirectionsModeDriving forKey:MKLaunchOptionsDirectionsModeKey];

[endingItem openInMapsWithLaunchOptions:launchOptions];
}
</code></pre>

<p>Here is the error I am getting in the debugger area:</p>

<p>-[MapViewController appleMapsClicked:]: unrecognized selector sent to instance 0x176564d0
2016-04-15 16:10:39.394 Restaurant[1081:220822] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MapViewController appleMapsClicked:]: unrecognized selector sent to instance 0x176564d0'</p>