title: Picker view does not return always the right value
body: <p>I've defined a picker which does not return always the right value. Sometimes it just works but most of the time when I pick the item pickerView returns the wrong value. </p>
  
  <p>I did associate the outlet delegate to the view controller and am using the following code:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UIPickerViewDelegate {
  
  var categories = ["animals", "profession", "sea_animals", "food", "tools", "misc", "all"]
  
  var cat: String = ""
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  func numberOfComponentsInPickerView(pickerView: UIPickerView) -&gt; Int {
      return 1
  }
  
  func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
      println("cat size: \(categories.count)")
      return categories.count
  }
  
  func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String!{
      println("cat: \(categories[row])")
        return categories[row]
  }
  </code></pre>
  
  <p>}</p>
  
  <p>it works sometime but it is not reliable.
  Any idea what I do wrongly?
  Thanks!</p>