iOS / ObjC,存储用户输入并检索它 [英] iOS/ObjC, storing user input and retrieving it

查看:72
本文介绍了iOS / ObjC,存储用户输入并检索它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS开发新手,我觉得我掌握了基础知识。我正在考虑一个我想制作的应用程序和所涉及的步骤,需要的组件......我不知道如何保存用户输入并检索它的最佳方法是什么。

Pretty new to iOS dev, I feel I have a grasp of the basics. I was thinking through an app I would like to make and the steps involved, components needed... and I have no idea how to or what is the best method to save user input and retrieve it.

一个例子是(我不打算做这个,但它说明了我想知道的事情),比如说一个简单的待办事项列表,它有从NSMutuableArray填充的NSTableView,开头它是空白的,因为用户没有添加任何内容。将项添加到数组后,由于-reloadData,表重新加载。表中显示了需要执行的项目。非常适合本次会议...但不会重新打开应用程序。

An example being (I don't plan to make this, but it illustrates what I want to know), say a simple to-do list, it has NSTableView that is populated from NSMutuableArray, to begin with it is blank as the user has added nothing. Once an item is added to the array, table reloads thanks to -reloadData. The item that is needed to-do is shown in the table. Great for this session... but not when the app is reopened.

我想我需要存储数组然后在应用程序下次初始化时重新加载它,这是正确的吗?

I imagine I need to store the array and then reload it when the app next initialises, is this correct?

或者还有其他更好的方法吗?

Or is there any other better method?

推荐答案

如果你刚刚开始。最好的方法是使用Core Data来保存和显示您的数据。你最后会感谢我。

If you're just starting out. The best way to go is to use Core Data to save and display your data. You'll thank me in the end.

http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/CoreData/cdProgrammingGuide.html #// apple_ref / doc / uid / TP30001200-SW1

教程

http://www.raywenderlich.com/934/core-data-tutorial-getting-已开始
http://developer.apple.com/cocoa/ coredatatutorial / index.html
http://themikeswan.wordpress .com / 2009/05/22/7 /

谷歌搜索有很多资源。

这篇关于iOS / ObjC,存储用户输入并检索它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆