简体   繁体   English

如何模拟iOS应用程序的更新

[英]How simulate update of iOS application

My application have several classes that implemented NSCoding protocol. 我的应用程序具有几个实现NSCoding协议的类。 And the app save instances of these classes to the file system 然后应用将这些类的实例保存到文件系统中

In near future I will publish a new version of my application. 在不久的将来,我将发布我的应用程序的新版本。 This app will include the changed logic of - (void) encodeWithCoder:(NSCoder *)coder and - (id) initWithCoder:(NSCoder *)aDecoder methods. 该应用将包含- (void) encodeWithCoder:(NSCoder *)coder- (id) initWithCoder:(NSCoder *)aDecoder方法的更改逻辑。

Question is: What is general approach to test that app after a update works good? 问题是:更新后测试该应用程序正常运行的一般方法是什么?

so, to my understanding you are asking , How to make sure that my app works correct or not with the updated code. 因此,据我所知,您在问,如何确保我的应用程序在更新后的代码中正确或不正确。

Which means, when the app after updating is run for the first time, will the encoded instances can be decoded and reused perfectly?. 这意味着,更新后的应用程序首次运行时,编码实例是否可以解码并完美重用?

If this is the case, for the new updated app - in the initWithEncoder method add a version key. 在这种情况下,对于新更新的应用程序-在initWithEncoder方法中添加version密钥。 If version is not present then those encoded files are of old version and write your code accordingly, if present then init the object as usual. 如果不存在版本,则那些编码文件为旧版本,并相应地编写您的代码(如果存在),则照常初始化该对象。

This is according to apple recommendation. 这是根据苹果的建议。

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

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