title: Invalid Argument Exception iOS
body: <p>I'm new to iOS programming. I got an error thats always bugging me for days. I tried Googling it but none of the answers seem to work (or it is just me not fully understanding how this stuff works).</p>
  
  <p><code>2014-11-10 12:45:26.858 Launchlabs Int[1502:60b] -[UIViewController buttonClicked:]: unrecognized selector sent to instance 0x8d57960
  2014-11-10 12:45:26.862 Launchlabs Int[1502:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController buttonClicked:]: unrecognized selector sent to instance 0x8d57960'
  </code></p>
  
  <p>My App Delegate header:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface AppDelegate : UIResponder &lt;UIApplicationDelegate&gt;
  
  @property (strong, nonatomic) UIWindow *window;
  @property (strong,nonatomic) UIViewController *firstScrn;
  @end
  </code></pre>
  
  <p>App Delegate implementation:</p>
  
  <pre><code>#import "AppDelegate.h"
  
  @implementation AppDelegate
  
  @synthesize firstScrn;
  
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
      self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  
      firstScrn = [[UIViewController alloc] initWithNibName:@"ViewController" bundle:nil];
      self.window.rootViewController = firstScrn;
  
      // Override point for customization after application launch.
      self.window.backgroundColor = [UIColor whiteColor];
      [self.window makeKeyAndVisible];
      return YES;
  }
  </code></pre>
  
  <p>ViewController h:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface ViewController : UIViewController
  
  @property (weak, nonatomic) IBOutlet UIButton *btn;
  
  - (IBAction)buttonClicked:(id)sender;
  -(IBAction)secondBtnClick:(id)sender;
  @end
  </code></pre>
  
  <p>ViewController m</p>
  
  <pre><code>#import "ViewController.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  
  - (IBAction)buttonClicked:(id)sender {
      NSLog(@"hello");
  }
  
  -(IBAction)secondBtnClick:(id)sender
  {
  
  }
  @end
  </code></pre>
  
  <p>heres the screenshot of my nib file: 
  <img src="https://i.stack.imgur.com/rioBf.png" alt="enter image description here"></p>