如何为 OS X 创建 Cocoa (Obj-C) 动态库?
所以基本上我想在 OS X 中创建一个使用 Cocoa 构建的动态库(在 Obj-C 中,而不是 C 或 C++)。我的问题是 - 我该怎么做?
最终我希望该库由另一个应用程序加载(我知道该怎么做)。我只是不知道如何使用 Objective-C 创建模块。
谢谢!
So basically I want to create a Dynamic Library in OS X that is built utilizing Cocoa (In Obj-C, not C or C++). My question is - how do I do this?
Ultimately I want the library to be loaded by another application (which I know how to do). I just don't know how to create a module utilizing Objective-C.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议创建您自己的框架而不是库。
指南 1
指南 2
如果你一心想要制作一个动态库,然后检查这个 指南 3 出来。我建议不要使用动态库,因为我相信 Apple 在批准 iPhone 应用程序时会禁止/不赞成它们。
框架将为您提供相同的功能,以及更多的资源、头文件等选项。此外,您将遵循 Apple 的设计模式,这意味着您的代码将运行得更好。
I suggest creating your own framework instead of a library.
Guide 1
Guide 2
If you're bent on making a Dynamic Lib then check this Guide 3 out. I recommend against dynamic libs because I believe they're banned/frowned upon by Apple when approving iPhone apps.
Frameworks will give you the same functionality, plus a ton more options for resources, headerfiles, etc. Plus, you'll be following Apple's design patterns which means your code will run better.