简体   繁体   English

将项目添加到.plist中,并在自定义UITableViewCell中显示

[英]Add items to .plist from and display in custom UITableViewCell

I want to write data to multiple NSMUtableArray 's from the user pressing IBAction 's that then saves the time they pressed it, Location and os on, to a .plist . 我想从用户按IBAction将数据写入多个NSMUtableArray ,然后将他们按时间(位置和操作系统)的时间保存到.plist I then want to retrieve the data that was written in the plist and display it in a custom UITableViewCell that I have created. 然后,我想检索写在plist中的数据,并将其显示在我创建的自定义UITableViewCell中。 There are around 8 - 10 different labels in the cell. 单元中大约有8-10个不同的标签。 I have already made the plist file history.plist and there are a few things in there. 我已经创建了plist文件的history.plist文件,并且其中包含一些内容。 I need the data to go in there. 我需要数据去那里。 And to keep writing data there, such that after the data is gathered, it will then be displayed in the custom cell within the UITableView . 并继续向其中写入数据,以便在收集数据之后,将其显示在UITableView的自定义单元中。 包含所需数据的plist

Should Item 0 be a dictionary or array? Item 0应该是字典还是数组?

So far I have the data being saved as NSUserDefaults 到目前为止,我已经将数据另存为NSUserDefaults 自定义单元

好吧,如果您想使用类似这样的plists,然后将第0项作为字典保存...但是,我强烈建议您使用Core Data而不是plists来存储数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM