哪些 iOS 版本支持带有 __weak 指示符的 ARC?

发布于 2024-12-25 04:43:34 字数 296 浏览 4 评论 0原文

我认为 __Weak 指示符只能在 iOS5 上使用,在以前的 iOS 版本上你必须使用 __unsafe_unretained 。但在此评论中 https://stackoverflow.com/a/8543037/904972 NJones 暗示 iOS 4.3+ 处理 __weak 引用而你必须在 iOS 上使用 __unsafe_unretained < 4.2.是这种情况还是我误解了这个帖子。如果是这种情况,您可以提供苹果“官方”答案的链接吗?

I thought that the __Weak designator would only work on iOS5 where you would have to use __unsafe_unretained on previous iOS versions. But in this comment https://stackoverflow.com/a/8543037/904972 NJones implies that iOS 4.3+ handles __weak references whereas you have to use __unsafe_unretained on iOS < 4.2. Is this the case or am I misunderstanding the post. If it is the case can you provide a link to an "official" answer from apple.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

强辩 2025-01-01 04:43:34

来自 http://developer.apple.com/library /mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/_index.html

Mac OS X v10.6 和 v10.7(64 位应用程序)以及 iOS 4 和 iOS 5 的 Xcode 4.2 支持 ARC。Mac OS X v10.6 和 iOS 4 不支持弱引用。

From http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/_index.html

ARC is supported in Xcode 4.2 for Mac OS X v10.6 and v10.7 (64-bit applications) and for iOS 4 and iOS 5. Weak references are not supported in Mac OS X v10.6 and iOS 4.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文