         Cd.transact {
             let newItem = Cd.create(ExampleItem.self)
             newItem.name = randomString
-            try! Cd.commit()
+        }
+    }
+    
+    func handleEdit(button: UIBarButtonItem) {
+        self.tableView.setEditing(!self.tableView.editing, animated: true)
+        if (self.tableView.editing) {
+            button.title = "Done"
+            button.style = .Done
+        } else {
+            button.title = "Edit"
+            button.style = .Plain
         }
     }
     

        self.view.backgroundColor = UIColor.whiteColor()
        self.title = "Example"
        
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Add", style: .Plain, target: self, action: "handleAdd:")
        
        fetchedResultsController = CdFetchedResultsController(
            fetchRequest: Cd.objects(ExampleItem.self).sorted("name").nsFetchRequest,

        // Dispose of any resources that can be recreated.
    }
    
    func handleAdd(button: UIBarButtonItem) {
        let allowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
        let allowedCharsCount = UInt32(allowedChars.characters.count)
        var randomString = ""
