使用 plist 填充分组表
我想使用 plist 来填充我的分组表。我已经查看了 DrillDownSave 示例项目,但我仍然一无所知。尽管如此,我确实了解到我可以在那里存储层次结构之类的东西。
所以问题如下:
如何使用我的 plist 将新项目添加到我的分组表中?我目前正在向表中添加一个数组,并且我注意到数组对我来说并不是最好的选择。
当用户点击plist中的某个项目时,如何将视图推送到相应的项目?换句话说,如何将基于所选行(由 plist 生成)的视图推送到其下一个“视图”?
如果这有意义,请回复。 谢谢, 杰克。
I was wanting to use a plist to populate my grouped table. I've had a look at the DrillDownSave sample project, and I'm still none-the-wiser. Although, I did learn that I could store hierarchies and suchlike in there.
So here's the questions:
How can I use my plist to add new items to my grouped table? I'm currently feeding the table with an array, and I've noticed that an array isn't going to be the best thing for me.
When a user taps on an item in the plist, how can I push the view to the corresponding item? In other words, how can I push the view based on the selected row (which was generated by the plist) to it's next "view"?
If that makes any sense, please reply.
Thanks,
Jack.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要将数组的 plist 表示形式加载到实际的
NSArray
实例中,请使用:要“向下钻取”,您需要在
UITableViewDelegate
的中执行以下操作-tableView:didSelectRowAtIndexPath:indexPath
方法:假设您要深入研究的对象是
Widget
,并且您的 widget 数组存储在名为widgets
的 ivar 中,您将添加一个widget
> 属性到您的详细视图控制器,然后执行如下操作:(这位于您的表视图委托中)
有关详细信息,请参阅 文档的这一部分。
To load a plist representation of an array into an actual
NSArray
instance, use:To "drill down", you need to do the following in your
UITableViewDelegate
's-tableView:didSelectRowAtIndexPath:indexPath
method:Assuming that the object you're drilling down onto is a
Widget
, and your array of widgets is stored in an ivar namedwidgets
, you would add awidget
property to your Detail View Controller, then do something like this:(this goes in your Table View Delegate)
For more info, see this part of the documentation.