iPhone 静态库中的 json-framework 错误

发布于 2024-08-24 04:39:17 字数 429 浏览 4 评论 0原文

我有一个使用 json-framework 的 iPhone 应用。我将一些代码(包括 json-framework 源代码)从主项目移至静态库。当我这样做时,json 框架停止编译成二进制文件(使用类转储进行双重检查)。这会导致一个严重的错误:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString JSONValue]: unrecognized selector sent to instance 0x43897f0'

静态库中的其他所有内容都继续正常运行。

I have an iPhone app that uses the json-framework. I moved some of the code, including the json-framework source, from the main project to a static library. When I did this, the json-framework stopped getting compiled into the binary (double checked with class dump). This causes a nasty error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString JSONValue]: unrecognized selector sent to instance 0x43897f0'

Everything else in the static library continues to function properly.

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

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

发布评论

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

评论(1

眉黛浅 2024-08-31 04:39:17

显然,除非您在链接器标志上撒上魔法灰尘,否则类别和静态库将无法工作。根据 技术问答,您必须添加主项目的 -ObjC 链接器标志(不是库,如问答中所述)。

Apparently, categories and static libraries don't work unless you sprinkle the magic dust on the linker flag. According to a Technical Q&A, you have to add the -ObjC linker flag to the main project (not the library, as stated in the Q&A).

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