 
 class MainTableViewController: UITableViewController {
 
-    var Names: [String] = []
+    var Names: [String] = [String]()
+    var people: [NSManagedObject] = [NSManagedObject]()
     let cellIdentifier = "reuseIdentifier"
     
     override func viewDidLoad() {


    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return self.Names.count
    }

    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier(self.cellIdentifier, forIndexPath: indexPath)

        cell.textLabel?.text = self.Names[indexPath.row]

        return cell
    }
    


        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem()
        let btnRefresh = UIBarButtonItem(title: "Refresh", style: UIBarButtonItemStyle.Plain, target: self, action: "loadData")
        self.navigationItem.rightBarButtonItem = btnRefresh
        let btnAdd = UIBarButtonItem(title: "Add", style: UIBarButtonItemStyle.Done, target: self, action: "AddName")
        self.navigationItem.leftBarButtonItem = btnAdd
        self.tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: self.cellIdentifier)
