开发者

Where do I store the Notes if I want an "Add Note" function in my app

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜