Edgars
Edgars

Reputation: 140

Error by trying to push mapViewController

-(IBAction)flipView:(id)sender
{
    MapController *nextVC = [[MapController alloc] initWithNibName:@"MapController" bundle:nil];
    nextVC.title = @"Map";
    nextVC.longi = [self.subject valueForKey:@"LongiS"];
    nextVC.lati = [self.subject valueForKey:@"LatiS"];

    [self.navigationController pushViewController:nextVC animated:YES];
}

And here is error: 2012-03-27 19:19:44.896 pop[6941:11603] -[DetailViewController flipView]: unrecognized selector sent to instance 0x6d87b90 2012-03-27 19:19:44.936 pop[6941:11603] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DetailViewController flipView]: unrecognized selector sent to instance 0x6d87b90' * First throw call stack: (0x189e052 0x16bed0a 0x189fced 0x1804f00 0x1804ce2 0x189fec9 0x4965c2 0x6d1d54 0x189fec9 0x4965c2 0x49655a 0x53bb76 0x53c03f 0x53b2fe 0x4bba30 0x4bbc56 0x4a2384 0x495aa9 0x16a1fa9 0x18721c5 0x17d7022 0x17d590a 0x17d4db4 0x17d4ccb 0x16a0879 0x16a093e 0x493a9b 0x2e90 0x26b5)

App crashes when I press flipView button..

Upvotes: 0

Views: 79

Answers (1)

beryllium
beryllium

Reputation: 29767

Add colon : to flipView selector:

UIBarButtonItem *flipButton = [[UIBarButtonItem alloc] initWithTitle:@"Map" 
                                                               style:UIBarButtonItemStyleBordered 
                                                              target:self
                                                              action:@selector(flipView:)];
self.navigationItem.rightBarButtonItem = flipButton; 

Change IBAction to void if you don't use IB.

Upvotes: 1

Related Questions