Frameworks vs. Bundles

纵然是瞬间 提交于 2019-12-07 05:51:51

问题


I want to be able to add plugins for an application I am developing and as it is a development tool I want other people to be able to write their own plugins.

So my questions are what are the real differences between a framework and a loadable bundle? Which are more suited to being a plugin(accessing of headers, ect) ? And if I use loadable bundles how do I load them at runtime and access their functionality during development?

The plugins should not have to rely on other plugins.


回答1:


Have you taken a look at NSBundle? It has all the methods you'll need to load the executable code at runtime. You'll want to define some sort of plugin interface to which any plugin will conform.

As for the difference between bundles and frameworks... Both bundles and frameworks are file structures that contain various resources that your app can use. A framework is like a library -- it's something your program links against when you build it. A bundle, on the other hand, is essentially a folder structure containing compiled code that you load at runtime.



来源:https://stackoverflow.com/questions/8721648/frameworks-vs-bundles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!