I want to add a simple note to my app. After searching, I found that I need: a tableView and the active Note's view "please tell me if I'm missing some thing".
What I couldn't find is How and Where to store the notes and how to r开发者_如何学运维etrieve it?
Thanks :)
For storing simple objects like strings for notes, take a look at NSUserDefaults.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:@"hello" forKey:@"key"]; // Store value.
NSString *note = [defaults objectForKey:@"key"]; // Retrieve value.
Core data provides a good mechanism for persisting data that is more complex. Check out the guide here: Core Data.
精彩评论