title: UIPickerView not reloading new data to UITableView when selected IOS Swift
body: <p>I am selecting a state from the statePicker and it is passing the state to an URL, which is then parsing the XML and uploading the XML to the TableView Cell. However when I select a new state it parses the XML and adds the data to the <code>TableView</code> Cell, but the previous selected state data does not clear from the <code>TableViewCell</code> </p>
  
  <pre><code>class ViewController: UIViewController{
  
  
  @IBOutlet weak var myTableView: UITableView!
  @IBOutlet weak var statePicker: UIPickerView!
  
  let statePicked:[String] = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "PH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "WA", "WV", "WI", "WY"]
  
  var weatherEvent:[String] = []
  var weatherExpires:[String] = []
  var weatherSummary:[String] = []
  var weatherEffective:[String] = []
  var weatherUrgency:[String] = []
  var weatherSeverity:[String] = []
  var weatherCertainty:[String] = []
  var weatherLink:[String] = []
  var weatherPolygon:[String] = []
  
  var xmlParser: NSXMLParser!
  var url: NSURL!
  var concate: String = ""
  
  var entryFound:Bool = false
  var eventFound: Bool = false
  var expiresFound: Bool = false
  var summaryFound:Bool = false
  var effectiveFound:Bool = false
  var urgencyFound:Bool = false
  var severityFound:Bool = false
  var certaintyFound:Bool = false
  var linkFound:Bool = false
  var polygonFound:Bool = false
  
  var link: String = ""
  var state: String = ""
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
      statePicker.delegate = self
      statePicker.dataSource = self
  
      xmlParser?.delegate = self
      myTableView.delegate = self
      myTableView.dataSource = self
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
      if(segue.identifier == "ShowDetail"){
          let detailVC = segue.destinationViewController as! DetailViewController
          if let indexPath = myTableView.indexPathForCell(sender as! WeatherCell){
              detailVC.event = weatherEvent[indexPath.row]
              detailVC.expires = weatherExpires[indexPath.row]
              detailVC.certainty = weatherCertainty[indexPath.row]
              detailVC.summary = weatherSummary[indexPath.row]
              detailVC.expires = weatherExpires[indexPath.row]
              detailVC.effective = weatherEffective[indexPath.row]
              detailVC.urgency = weatherUrgency[indexPath.row]
              detailVC.severity = weatherSeverity[indexPath.row]
              detailVC.link = weatherLink[indexPath.row]
          }
      }
  }
  }
  </code></pre>
  
  <p>And the extension code:</p>
  
  <pre><code>extension ViewController: UIPickerViewDelegate, UIPickerViewDataSource {
  
  
  func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
      return self.statePicked.count
  }
  
  func numberOfComponentsInPickerView(pickerView: UIPickerView) -&gt; Int {
      return 1
  }
  
  func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String? {
      return self.statePicked[row]
  }
  
  func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
      state = self.statePicked[row]
      concate = "http://alerts.weather.gov/cap/".stringByAppendingString(state.lowercaseString) + ".php?x=0"
      url = NSURL(string: concate)
      xmlParser = NSXMLParser(contentsOfURL: url!)
      xmlParser?.delegate = self
      xmlParser?.parse()
      myTableView.reloadData()
      print("state after \(state.lowercaseString)")
  }
  }
  </code></pre>
  
  <p>Any Help?</p>