0
-(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..

jonkroll
  • 15,682
  • 4
  • 50
  • 43
Edgars
  • 140
  • 1
  • 11
  • Check connections for flipView in Interface Builder, resolve warning if that is. – beryllium Mar 27 '12 at 16:40
  • Button is created programmatically, not in interface. As well it's on navigation bar. – Edgars Mar 27 '12 at 16:42
  • Also when i change action to happen when button is pressed i get this error this class is not key value coding-compliant for the key c. And all my data come from plist – Edgars Mar 27 '12 at 16:50
  • Can you show the code where you are creating the button? Particularly where you add the target action to the button. – jonkroll Mar 27 '12 at 16:55
  • UIBarButtonItem *flipButton = [[UIBarButtonItem alloc] initWithTitle:@"Map" style:UIBarButtonItemStyleBordered target:self action:@selector(flipView)]; self.navigationItem.rightBarButtonItem = flipButton; – Edgars Mar 27 '12 at 16:57

1 Answers1

1

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.

beryllium
  • 29,669
  • 15
  • 106
  • 125
  • I have exactly what you wrote. ahh, and before, when I crated my data for table from NSArray there wasn't problem, but when I changed it to plist file error occurs. – Edgars Mar 27 '12 at 17:23
  • 1
    @user1259799, your comment shows difference with my comment, check it - `@selector(flipView:)` – beryllium Mar 27 '12 at 17:25
  • Still error :( this class is not key value coding-compliant for the key c. – Edgars Mar 27 '12 at 17:32
  • http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for-the-key – beryllium Mar 27 '12 at 17:42
  • Maybe I dont understand right, but i think problem is not there.. Could you please look at my sorce? – Edgars Mar 27 '12 at 17:48
  • Sorry, now I cann't look it.. I can fix it tomorrow – beryllium Mar 27 '12 at 17:50
  • Ohh, just solved, dammn it was so stupid, i had just label in map view, wich was connected to Files owner, but its property was deleted, any way, thank you for your Beryllium time :) – Edgars Mar 27 '12 at 18:06