iOS 8是否支持动态链接? [英] Does iOS 8 support dynamic linking?

查看:107
本文介绍了iOS 8是否支持动态链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到iOS7,由于安全问题,Apple不支持动态链接。开发人员之间的代码重用通常依赖于静态库,静态库是作为应用程序可执行文件的一部分构建的。

Up until iOS7, Apple did not support dynamic linking due to security concerns. Code reuse between developers usually relied on static libraries, which were built as part of the executable of the app.

在iOS8中引入扩展似乎改变了一点,因为扩展是单独的可执行文件。在扩展及其包含应用程序之间共享代码是通过框架完成的。 Apple在他们的发行说明中这样说:

Introducing extensions in iOS8 seems to change this a bit, because extensions are separate executables. Sharing code between an extension and its containing app is done via a framework. Apple is saying this in their release notes:


iOS的框架。 iOS开发人员现在可以创建动态框架。
框架是一个代码和资源的集合,用于封装在多个项目中有价值的
功能。框架
与扩展完美配合,共享逻辑,主要应用程序和捆绑扩展可以使用

Frameworks for iOS. iOS developers can now create dynamic frameworks. Frameworks are a collection of code and resources to encapsulate functionality that is valuable across multiple projects. Frameworks work perfectly with extensions, sharing logic that can be used by both the main application, and the bundled extensions.

重点是我的。

来源: https://developer.apple.com/library/content/documentation/Xcode/Conceptual/WhatsNewXcode -Archive / Articles / xcode_6_0.html#// apple_ref / doc / uid / TP40014509-SW14

此外,在扩展开发指南中,他们解释说您可以通过嵌入式框架在扩展程序和包含应用程序之间共享代码。

Further, in the extension dev guide, they explain that you can share code between an extension and the containing app via a "embedded framework".

来源: https://developer.apple.com/library/ content / documentation / General / Conceptual / ExtensibilityPG / ExtensionScenarios.html#// apple_ref / doc / uid / TP40014214-CH21-SW1

我的问题是 - 什么是嵌入式框架,它与动态框架有什么不同,我们真的会在iOS8中看到正确的动态链接吗?我读过的所有文档似乎都含糊不清。

My question is - what is an embedded framework, how does it differ from a dynamic framework, and will we really see proper dynamic linking in iOS8? All the documentation I've read seems ambiguous about this.

推荐答案

嵌入式和动态框架不是指框架的相同方面。它们并不是彼此相反的。首先,让我们定义什么是框架:在Apple术语中,框架引用一些编译代码+所述代码的公共头文件。

"Embedded" and "Dynamic" frameworks don't refer to the same aspect of frameworks. They are not the opposite of one another. First, let's define what's a framework: in Apple lingo, a framework refers to some compiled code + the public headers of said code.


  • <现在,动态框架是一个框架,其代码构建为动态库。它与静态框架相反,其中代码将构建为静态库。如果你想知道,维基百科有一个非常好的解释静态和动态库之间的区别。
  • Now a dynamic framework is a framework whose code was built as a dynamic library. It is the opposite of a "static" framework, where the code would be built as a static library. In case you're wondering, Wikipedia has a very nice explanation of what's the difference between a static and a dynamic library.

最后,嵌入式框架是一个打包在应用程序中的框架,而不是在系统范围内安装, / System / Library / Frameworks例如。

And finally, an embedded framework is a framework that is packaged within an app, as opposed to being installed system-wide, in "/System/Library/Frameworks" for example.

这篇关于iOS 8是否支持动态链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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