什么是“弱框架参考”? [英] What is a “weak framework reference”?

查看:149
本文介绍了什么是“弱框架参考”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iphone sdk中对框架的弱引用是什么意思?

What does it mean to have a weak reference to a framework in iphone sdk?

推荐答案

在实践中,如果你构建一个带有框架所需引用的应用程序,而不是弱引用,并尝试在不包含该框架的设备上运行该应用程序,即使您不尝试使用该框架,该应用程序也会崩溃。

In practice, if you build an app with a required reference to a framework, rather than a weak reference, and try to run that app on a device which doesn't include that framework, the app with crash, even if you don't try to use that framework.

但是,如果您构建的应用程序对框架的弱引用,并在不支持该框架的设备上运行它,并且不访问类(在该框架中的方法,子例程等)(因为您事先测试了该框架是否存在运行时),那么您的应用程序不会简单地在启动时崩溃。但由于框架链接很弱,您可以在支持该框架的设备上从同一个应用程序调用该框架。因此,您的应用程序可能支持不同的操作系统版本,有或没有对给定框架的支持。

If, however, you build an app with a weak reference to a framework, and run it on a device that does not support that framework, and do not access classes (methods, subroutines, etc.) in that framework (because you, say, run-time tested for the existence of that framework beforehand) then your app will not simply crash on startup. But since the framework is weakly linked, you could call that framework from that same app on a device which supported that framework. Thus your app might support different OS versions with and without support for a given framework.

启动时间可能会有一些性能差异导致启动弱引用的应用程序慢得多。

There might also be some performance differences in start up time causing apps with weak references to launch much slower.

这篇关于什么是“弱框架参考”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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