弱链接 UIPopoverBackgroundView [英] Weak linking UIPopoverBackgroundView

查看:40
本文介绍了弱链接 UIPopoverBackgroundView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目必须部署到 4.0,但有一些仅适用于 5.0 的功能,例如 UI 自定义.

I have a project that has to be deployed to 4.0 but has some features that are 5.0 only, such as UI customization.

我希望我的 UIPopoverBackgroundView 子类是弱链接,但在 4.X 设备上启动时总是出现以下错误

I want my UIPopoverBackgroundView subclass to be weak linked, but I always get the following error when launching on 4.X devices

        dyld: Symbol not found: _OBJC_CLASS_$_UIPopoverBackgroundView

我不能使用 NS_CLASS_AVAILABLE 宏,因为我自定义的弹出窗口背景是 UIPopoverBackgroundView 类的子类,所以它必须在 .h 中声明.如何仅弱链接 UIKit 的一部分?或者有没有其他方法可以解决这个问题?

I can't use the NS_CLASS_AVAILABLE macro since my custom Background of the popover is a subclass of the UIPopoverBackgroundView class, so it has to be declared in a .h . How can I weak link only part of UIKit? Or is there any other way around this issue?

谢谢大家

推荐答案

经过大量谷歌搜索,结果 Marco 找到了答案......

After a lot of googling, turns out that Marco had the answer...

http://www.marco.org/2010/11/22/supporting-older-versions-of-ios-while-using-new-apis

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

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