title: ios swift uitabbar replace view controllers crashes
body: <p>I am really struggling with what should be a simple bit of code.</p>
  
  <p>I have an ios app that has 4 tabs in the uitabcontroller, depending on the a setting in another tab I wanted to replace the controller the first tab goes to.  I found that I couldnt simply replace this first tab (although i managed it somehow for a couple of builds then it stopped working after a clean).</p>
  
  <p>So I went for the option of replacing the viewcontrollers that the tab controller references with the .setViewControllers method.  I call this from my viewcontroller after the viewdidload method.</p>
  
  <pre><code>let storyboard = UIStoryboard(name: "Main", bundle: nil)
  let vc0 = storyboard.instantiateViewControllerWithIdentifier("collection")
  let vc4 = storyboard.instantiateViewControllerWithIdentifier("profilenews1")
  
  let vc1: UIViewController! = storyboard.instantiateViewControllerWithIdentifier("news") as UIViewController
  let vc2: UIViewController! = storyboard.instantiateViewControllerWithIdentifier("create") as UIViewController
  let vc3: UIViewController! = storyboard.instantiateViewControllerWithIdentifier("search") as UIViewController
  
  let controllers = [vc0,vc4]
  self.tabBarController?.setViewControllers(controllers, animated: true)
  </code></pre>
  
  <p>From the research I have done this should work, setViewControllers is documented and I have seen numerous objective c examples but I get EXEC_BAD_INSTRUCTION thrown.</p>
  
  <p>I have checked that the tabcontroller is correct before I replace by doing</p>
  
  <pre><code>println("number of navs: \(self.tabBarController?.viewControllers?.count)")
  </code></pre>
  
  <p>And that prints the correct number of controllers.</p>
  
  <p>Any ideas?</p>