         
     }
     
-    
+ 
     func startObservingPerson(person: Person)
     {
         person.addObserver(self, forKeyPath: "personName", options: NSKeyValueObservingOptions.Old, context: &RMDocumentKVOContext)

        }
        
        self.employees.removeObjectAtIndex(index)
    }
    
    
    func removeObjectAtEmployeeControllerIndex(index: Int) {
        let p: Person = self.employees.objectAtIndex(index) as Person
        println("removing \(p) to \(self.employees)")
        let undo = self.undoManager
        
        undo?.prepareWithInvocationTarget(self).insertObject(p, atArrangedObjectIndex: index)
        
        
        if (false == undo?.undoing) {
            undo?.setActionName("Remove Person")
        }
        
        self.employees.removeObjectAtIndex(index)
        
    }
    
    
    func removeObjectFromeEmployeeControllerIndex(index: Int) {
        let p: Person = self.employees.objectAtIndex(index) as Person
        println("removing \(p) to \(self.employees)")
        let undo = self.undoManager
        
        undo?.prepareWithInvocationTarget(self).insertObject(p, atArrangedObjectIndex: index)
        
        
        if (false == undo?.undoing) {
            undo?.setActionName("Remove Person")
        }
        
        self.employees.removeObjectAtIndex(index)
    }
    
    
    
    
    
    
    
}


    @IBAction func onCheck(sender: AnyObject) {
        println(self.employees)
    }
   
    @IBAction func createEmployee(sender: AnyObject)
    {
        let w: NSWindow = self.tableView.window!
