title: ios: leftBarButtonItem.target and .action
body: <p>I'm having a Login view controller where I create navigationController, and create <code>leftBarButtonItem</code> and <code>rightBarButtonItems</code> using custom views (which are <code>UIButton</code>). Now here only I set bar button items of <code>navigationController</code> so that they can be accessed by all view controller pushed on that navigationController using:</p>
  
  <pre><code>navigationController.navigationItem.rightBarButtonItems = [someBarButton, someOtherBarButton]
  navigationController.navigationItem.leftBarButtonItem = backBarButton
  </code></pre>
  
  <p>Now for each view controller I set <code>self.navigationItem.leftBarButtonItem = self.navigationController.navigationItem.leftBatButtonItem</code>. I can view the button. Now as the methods for pressing these should be implemented in the view controller I tried this in <code>viewDidLoad()</code> of view controller:</p>
  
  <pre><code>self.navigationItem.leftBarButtonItem!.target = self
  self.navigationItem.leftBarButtonItem!.action = Selector("backButtonPressed")
  </code></pre>
  
  <p>But I'm not getting any call backs in the methods: </p>
  
  <pre><code>func backButtonPressed() {
      println("Back pressed")
      popViewController()
  }
  </code></pre>
  
  <p><strong>EDIT #1:</strong> Code where I set my leftBarButtonItem in Login view controller:</p>
  
  <pre><code>let navigationController = UINavigationController()
  
  let backButton = UIButton(frame: CGRectMake(0, 0, kNavBarIconHeight, kNavBarIconHeight))
  backButton.setImage(UIImage(named: "backButton"), forState: UIControlState.Normal)
  let backBarButton = UIBarButtonItem(customView: backButton)
  
  navigationController.navigationItem.leftBarButtonItem = backBarButton
  </code></pre>
  
  <p>I'm using the barButtonItem of navigationController and not the the previous controller in view controller stack</p>