Tyler Wall
Tyler Wall

Reputation: 3788

Persistent unrecognized selector error [Storyboards]

I have set up a million and one views with button's and functions. But for some reason I can't get this one to work - I've re-made it 3 times now ... I have no idea why it's not working...

From the error that I'm getting I understand it has something to do with the storyboard (this question, this question...) because in the error it says: [UIViewController click_newsletter:] not [LinkedinActionViewController click_newsletter:].

The problem is, I deleted the old viewController and made a new one and nothing changed?

Storyboard Class linking

enter image description here

In the story board - the class name is the same.

Class Declaration

@interface LinkedinActionViewController : UINavigationController <UIWebViewDelegate>{
    UIButton *our_page;
    UIButton *newsletter;
}

@property (nonatomic, retain) IBOutlet UIButton *our_page;
@property (nonatomic, retain) IBOutlet UIButton *newsletter;

- (IBAction)click_our_page:(id)sender;
- (IBAction)click_newsletter:(id)sender;


@end

Opening the view

        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil];
        LinkedinActionViewController *action_view = (LinkedinActionViewController*)[[storyboard instantiateViewControllerWithIdentifier:@"LinkedinActionViewController"] retain];
        [self.navigationController pushViewController:action_view animated:YES];

ERRROR!!!

enter image description here

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController click_newsletter:]: unrecognized selector sent to instance 0x6d205a0'

I've hit my head on the wall with this for over a day - any help would be beneficial! :D THANKS!

Upvotes: 1

Views: 432

Answers (1)

Tyler Wall
Tyler Wall

Reputation: 3788

Alright, just had a friend take a look at this and we found the problem.

If you go to the linkedinActionViewController.m file.

Click on file inspector button in the right pane.

File Inspector Tab

Then MAKE SURE THE CHECK BOX IS CHECKED!@!!!!

enter image description here

May XCode die a slow and painful death!

Upvotes: 3

Related Questions