iPhone 设备 3.0 的静态库中的类别 [英] Categories in static library for iPhone device 3.0

查看:13
本文介绍了iPhone 设备 3.0 的静态库中的类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的静态库中有类别.任何应用程序开发人员都应将 -ObjC 标志设置为其他链接器标志"以正确使用我的静态库.它适用于 iPhone 设备/iPhone Simulator 2.x 和 iPhone Simulator 3.0.但它会在 iPhone 设备 3.0 上崩溃.正如在本文中所写,这是新的链接器错误.他们建议多使用一个链接器标志:-all_load.但是当我添加这个标志时,构建也失败了,因为有重复的符号.

I have categories in my static library. Any application developer should set -ObjC flag to "Other Linker Flags" to use my static library properly. It works fine for iPhone device/iPhone Simulator 2.x and iPhone Simulator 3.0. But it crashes for iPhone device 3.0. As written in this article it is new linker bug. They suggest to use one more linker flag: -all_load. But when I add this flag, build fails too, because there are duplicate symbols.

如何在 iPhone 设备 3.0 的静态库中使用类别?有什么建议吗?

How to use categories in static libraries for iPhone device 3.0? Any suggestions?

推荐答案

我们遇到了同样的问题(在 3.0 下,-ObjC 不再链接类别)/" rel="nofollow noreferrer">核心绘图框架.我只能说,对我们来说,我们能够将 -all_load 选项添加到目标应用程序中的其他链接器标志,这消除了运行时错误.我们没有看到任何重复符号的警告.

We ran into the same problem (under 3.0, -ObjC no longer links in categories) within the Core Plot framework. All I can say is that for us, we were able to add the -all_load option to the Other Linker Flags within the target application and that did away with the runtime errors. We didn't see any warnings for duplicate symbols.

我已经提交了链接器行为的错误报告,我相信其他人也有.

I've filed a bug report for the linker behavior, as I'm sure others have.

这篇关于iPhone 设备 3.0 的静态库中的类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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