title: On button click "unrecognized selector sent to instance"
body: <p>Cocoa/Objective-C newbie here.</p>
  
  <p>I have a MainMenu.xib file which has a <code>NSView</code>.
  This is what <code>awakeFromNib</code> in AppDelegate.h looks like :</p>
  
  <pre><code>- (void)awakeFromNib {
  NSViewController *x = [[Login alloc] initWithNibName:@"Login" bundle:nil];
  NSView *v = [x view];
  [_theView addSubview:v];    
  </code></pre>
  
  <p>}</p>
  
  <p>The new view has a button but when I click on it, I get the message "unrecognized selector sent to instance".</p>
  
  <p>I'm completely lost. Please help me with this. Thanks!</p>
  
  <p>It also throws as "Thread 1: EXC_BAD_ACCESS (code = 1, address = ...) at the line (in main.m):</p>
  
  <pre><code>return NSApplicationMain(argc, argv);
  </code></pre>
  
  <p>The error is :</p>
  
  <p>2014-10-14 09:05:09.743 FAST Tax Scanner[18408:303] -[OS_dispatch_queue_runloop login:]: unrecognized selector sent to instance 0x6000000f7900
  2014-10-14 09:05:09.743 FAST Tax Scanner[18408:303] -[OS_dispatch_queue_runloop login:]: unrecognized selector sent to instance 0x6000000f7900
  2014-10-14 09:05:09.744 FAST Tax Scanner[18408:303] (
      0   CoreFoundation                      0x00007fff9484725c <strong>exceptionPreprocess + 172
      1   libobjc.A.dylib                     0x00007fff8c72fe75 objc_exception_throw + 43
      2   CoreFoundation                      0x00007fff9484a12d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
      3   CoreFoundation                      0x00007fff947a5272 ___forwarding_</strong> + 1010
      4   CoreFoundation                      0x00007fff947a4df8 _CF_forwarding_prep_0 + 120
      5   AppKit                              0x00007fff8b87d260 -[NSApplication sendAction:to:from:] + 327
      6   AppKit                              0x00007fff8b87d0de -[NSControl sendAction:to:] + 86
      7   AppKit                              0x00007fff8b8c9c4d -[NSCell _sendActionFrom:] + 128
      8   AppKit                              0x00007fff8b8e3655 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2316
      9   AppKit                              0x00007fff8b8e2a27 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 487
      10  AppKit                              0x00007fff8b8e213d -[NSControl mouseDown:] + 706
      11  AppKit                              0x00007fff8b863a58 -[NSWindow sendEvent:] + 11296
      12  AppKit                              0x00007fff8b8025d4 -[NSApplication sendEvent:] + 2021
      13  AppKit                              0x00007fff8b6529f9 -[NSApplication run] + 646
      14  AppKit                              0x00007fff8b63d783 NSApplicationMain + 940
      15  FAST Tax Scanner                    0x0000000100001452 main + 34
      16  libdyld.dylib                       0x00007fff982c55fd start + 1
      17  ???                                 0x0000000000000003 0x0 + 3
  )</p>