Just now I wrote the code which is provided below. I would like to produce the output for the following code but it crashes when I run it, and it shows `nil`. 

```
class ViewController: UIViewController ,UITableViewDataSource{
var names = [String]()

@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
    super.viewDidLoad()
    title = "\"The List\""
    tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "Cell")
    // Do any additional setup after loading the view, typically from a nib.
}

@IBAction func addName(sender: AnyObject) {
    let alert = UIAlertController(title: "New name", message: "Add one new name here", preferredStyle: .Alert)
    let saveAction = UIAlertAction(title: "Save", style: .Default, handler: {(action:UIAlertAction) ->Void in
        alert.addTextFieldWithConfigurationHandler{(textField:UITextField)->Void in
            alert.view.endEditing(true)
            let textField = alert.textFields?.last
            self.names.append(textField!.text!)
            self.tableView.reloadData()
        }

    })
    let cancleAction = UIAlertAction(title: "Cancel", style: .Default, handler: {(action:UIAlertAction) ->Void in
        alert.addTextFieldWithConfigurationHandler {(textFiled:UITextField) ->Void in
        }
                })
    alert.addAction(saveAction)
    alert.addAction(cancleAction)
    self.presentViewController(alert,animated:true,completion:nil)

}

    //MARK:-TableViewDataSource
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return names.count

}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("Cell")
    cell?.textLabel?.text = names[indexPath.row]
    return cell!

}
}

```

How to fix it???