开发者

Confused about how to update my datasources on my UITableView after app has been released

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.

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:@"pl开发者_Python百科ist"];
TableDSource = [[NSArray alloc]initWithContentsOfFile:pathToPlist];

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?

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.

Thanks


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜