         let gestureRecognizer = UITapGestureRecognizer(target: self, action: Selector("hideKeyboard:"))
         gestureRecognizer.cancelsTouchesInView = false
         tableView.addGestureRecognizer(gestureRecognizer)
+        
+        listenForBackgroundNotification()
+    }
+    
+    deinit {
+            print("*** deinit \(self)")
+            NSNotificationCenter.defaultCenter().removeObserver(observer)
     }
     
     // MARK: - Action

        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        

    var managedObjectContext: NSManagedObjectContext!
    var date = NSDate()
    var image: UIImage?
    var observer: AnyObject!
    
    var descriptionText = ""
    var locationToEdit: Location? {
