title: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_.AppDelegate add:]: unrecognized selector
body: <p>I created a storyboard called Main.storyboard and created a AddBtnViewController with storyboard ID "addBtnVC". In the App Delegate, I initialized a tab bar with three view controllers programmatically. For one of tab bar view controllers, I created an add button that would transition to the AddBtnViewController programmatically. However, I received this error:
  </p>
  
  <pre><code>uncaught exception 'NSInvalidArgumentException', reason: '-[_.AppDelegate add:]: unrecognized selector sent to instance 0x7f91cb422a30'
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>class AppDelegate: UIResponder, UIApplicationDelegate {
      func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
           //Make add btn for View Controller 1 of Navigation Bar
           let addBtn = UIButton(frame: CGRectMake(0, 0, 30, 30))
           addBtn.addTarget(self, action: #selector(ViewController1.add), forControlEvents: .TouchUpInside)
  
           let rightBarButton = UIBarButtonItem()
           rightBarButton.customView = addBtn
           NavController.navigationBar.topItem?.rightBarButtonItem = rightBarButton
  
           return true
      }
  }
  
  class ViewController1: UIViewController {
      let addBtnVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("addBtnVC")
  
      func add(sender: UIButton!) {
          if let addBtnVC = storyboard!.instantiateViewControllerWithIdentifier("addBtnVC") as? AddBtnViewController {
              presentViewController(addBtnVC, animated: true, completion: nil)
          }
      }
  }
  </code></pre>
  
  <p>How do I fix this error?</p>
  
  <p>For posterity:</p>
  
  <pre><code>class AppDelegate: UIResponder, UIApplicationDelegate {
      func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
           let VC1 = UIViewController()
  
           //Make add btn for View Controller 1 of Navigation Bar
           let addBtn = UIButton(frame: CGRectMake(0, 0, 30, 30))
           addBtn.addTarget(VC1, action: #selector(VC1.add(_:)), forControlEvents: .TouchUpInside)
  
           let rightBarButton = UIBarButtonItem()
           rightBarButton.customView = addBtn
           NavController.navigationBar.topItem?.rightBarButtonItem = rightBarButton
  
           return true
      }
  }
  
  class ViewController1: UIViewController {
      let addBtnVC:AddButtonViewController = AddButtonViewController()
  
      func add(sender: UIButton!) {
          let navController = UINavigationController(rootViewController: addBtnVC)
          navController.navigationBar.tintColor = colorPalette.red
          self.presentViewController(navController, animated: true, completion: nil)
      }
  
  }
  </code></pre>