发布应用程序后如何在UITableView上更新数据源感到困惑 [英] Confused about how to update my datasources on my UITableView after app has been released

查看:44
本文介绍了发布应用程序后如何在UITableView上更新数据源感到困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读文档后,我似乎对数据管理的一些概念有误解.因此,我试图澄清一些方面.抱歉,这篇帖子听起来多余且重复.

I seem to have a misunderstood some concepts about data management after reading the docs. So Im trying to clarify some aspects. Apologize if this post sounds redundant and repetitive.

我的应用程序具有多个TableViews.每个表视图都有一个pList形式的数据源.因此,我有几个属性列表可以用作表的数据源.目前,他们正坐在我的NSBundle中.然后我从它们中读取数据,并启动一个数组或字典来填充我的表

My app has multiple TableViews. Each tableview has a datasource in the form of a pList. I thus have several propertylists that serve as the data sources for my tables. Currently, they are sitting within my NSBundle. And I read data from them and initiate an array or dictionary to populate my tables

NSString *pathToPlist = [[NSBundle mainBundle] 
                     pathForResource:@"TableViewDataSource" ofType:@"plist"];
TableDSource = [[NSArray alloc]initWithContentsOfFile:pathToPlist];

现在,我想让tableView中的内容保持动态.我的意思是说,例如tableView包含待售商品的列表,在大约一个月内,企业主可能会决定更改该列表或商品的价格,等等.当我发货我的应用程序时,要出售的商品pList中包含的内容也随应用程序一起提供.

Now, I want to keep content within my tableView dynamic. What I mean is say the tableView for example contains a list of items for sale, In about a month the business owner might decide to change that list or the prices of the items, etc. When I ship my app, the items for sale which are in the pList are shipped also shipped with the app.

当有人下载​​了该应用程序之后,我该如何在以后的时间更新该属性列表?每当应用程序中的任何数据发生更改时,我都必须发布该应用程序的新版本吗?

How then do I update that property list at a later time after someone has downloaded the app? Do I have to issue a new release of the app each time any data within the app has changed?

还是我可以从头开始编程,使pList是动态的,而新的pList可以替换旧的pList,而无需更新应用程序?

or can I program right from the beginning in such a way that the pLists are dynamic and new ones can replace old ones without updating the app?

请帮助我理解这一点,而不是了解我的工作原理.

Please help me understand this, im not gettig how that works.

谢谢

推荐答案

一般机制是,您可以将捆绑包中的plist复制到可以写入的位置(例如Documents目录).然后,您将在该应用程序要检查的网站上更新列表,当它找到一个新列表时,它将下载该列表并替换现有的plist文件.

The general mechanism is that you would copy the plist out of the bundle into somewhere you can write to (like the Documents directory). You would then have updated lists on a web site that the app would check for, when it found a new one it would download it and replace the existing plist file.

这篇关于发布应用程序后如何在UITableView上更新数据源感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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