如何更新IOS中的应用程序文件(html)? [英] How to update App files (html) in IOS?

查看:86
本文介绍了如何更新IOS中的应用程序文件(html)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序非常简单。我有几个plists与HTML文件的文件名。当用户选择一行时,webview会加载该html文件及其内容。我很好奇如何处理应用程序更新?例如:我有一个新的更新的HTML文件,更正,我希望用户通过点击应用程序中的按钮来下载。我想将旧文件(html)替换为新文件。有没有办法做到这一点?不知道从哪里开始,希望有人能指引我走向正确的方向。我假设,没有办法更新plist,我不得不从plist切换到数据库,但问题仍然存在,我如何让应用程序下载新文件并替换旧文件?



谢谢

只需详细说明一下。



我想我试图找出正确的方法来完成我的应用程序更新。我的HTML文件是在应用程序内,即时通讯假设我可能已初始化应用程序连接到互联网并下载最新的内容文件(HTML,plists),将它们放入文档文件夹,然后更新我的主屏幕plist文件?这是一个正确的思路吗?



我不希望应用只能上网,需要这些html文件脱机。

解决方案

答案与您所描述的完全相同。



我最常见的火车是检查在文档中存在,如果它们不存在,则将它们从捆绑中添加。



使用它们,并在后台下载新的。 (如果互联网可用)。
在发生成功下载的情况下用新的替换旧的。



然后设置某种类型的超时,以便每次都不要下载一个新的第二。

我喜欢我的超时一天。

并实现一种检查服务器版本的方法。 (MD5哈希和文件大小是一个很好的,更不用说小比较)

祝你好运

My app is really simple. I have a few plists with file names of html files. When user selects a row, webview loads that html file with its content. Im curious how to approach app updates? For example: I have a new updated html file, with corrections, that I would like user to download by clicking a button in the app. I would like the old file(html) to be replaced by a new one. Is there a way to do this? Not really sure where to start, hopefully someone can point me in the right direction. Im assuming, there would be no way to update the plist, I would have to switch from plist to a database, but the question still remains, how do I get the app to download the new file and replace the old one?

Thank you

Just to elaborate a bit more.

I guess im trying to figure out the right way to do accomplish update within my app. My html files are within the app, im assuming i might have the app initally connect to the internet and download the latest content files(html,plists), place them into documents folder and then update my home screen plist file? Is this the correct train of thought?

I do not want the app to be internet only, need those html files to be available off line.

解决方案

The answer is exactly what you described.

My most common train is to check for the existence in documents, add them from the bundle if they are not there.

use them, and download new ones in the background. (if the internet is available). replace the old ones with the new ones in the event a successful download happens.

And set a timeout of some type so you dont download a new one every second.

I like a day for my timeout.

and implement a way to check the version with the server. (MD5 Hash and filesize is a good not to mention small comparison)

Good luck

这篇关于如何更新IOS中的应用程序文件(html)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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