I made a to do list app and I got an array called toDo
& a textView in each cell. I want the array to be saved in the NSUserDefaults
, but whenever I quit the app and open it again - it doesn't save it.
Here is what I tried:
let def = NSUserDefaults.standardUserDefaults()
var key = "keySave"
override func viewDidLoad() {
super.viewDidLoad()
def.setObject(toDo, forKey: "keySave")
}
func textViewDidEndEditing(textView: UITextView) {
todoTableView.reloadData()
def.setObject(toDo, forKey: "keySave")
}