iPhone可以动态插入代码吗? [英] Is dynamic code insertion possible in iphone?

查看:50
本文介绍了iPhone可以动态插入代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我进行小的更改时,我都需要提交应用程序以供批准,并且需要等待审核过程完成,因此,直到可以利用动态代码插入的程度,或者至少可以更改视图控制器的视图为止使用将要动态下载到文档目录中的nib文件?

Each time i make small changes, i need to submit the app for approval and need to wait to review process to complete, so till what extent i can exploit dynamic code insertion or at least can i change the view of a view controller using the nib file which i will be downloading to document directory dynamically?

推荐答案

在大多数情况下,答案是否定的,并且故意如此。特别是,您无法运行您下载的可执行代码。如果您想出一种技术上允许它的变通办法(并且我至少会考虑一两次,我将如何攻击它),它肯定会与苹果公司的批准程序背道而驰。

For the most part, the answer is no, and intentionally so. In particular, you cannot run executable code that you download. If you figured out a workaround to allow it technically (and I have at least one or two thoughts in mind on how I'd attack it), it would definitely run counter to Apple's approval process.

另一方面,nib文件是数据,而不是代码。您绝对可以从磁盘读取并使用 [UINib nibWithData:bundle:] 实例化。不过,这是一个很大的麻烦,我不特别推荐。但这是相对简单的(除非您想正确处理内存不足的情况,否则会有些麻烦)。

On the other hand, a nib file is data, not code. That you can definitely read from disk and instantiate using [UINib nibWithData:bundle:]. This is a pretty big hassle, though, and I don't particularly recommend it. But it's relatively straightforward (unless you want to correctly handle low memory situations, in which case it's a bit more of a hassle).

当然,您始终可以拥有动态代码

Of course you can always have dynamic code by putting it in a webview and writing it in JavaScript.

尽管如此,最后,审查过程才是有目的的,我建议开发人员适应他们的需求。开发周期将其包括在内。通常,这意味着要进行更严格的测试才能发布更少的版本,因为一个快速修复的成本很高。

In the end, though, the review process is the way it is on purpose, and I recommend developers adapt their development cycle to include it. That generally means having fewer releases with heavier testing because "one quick fix" is expensive.

这篇关于iPhone可以动态插入代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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