How should I handle header files in a bundle?

Posted by ldiqual on Stack Overflow See other posts from Stack Overflow or by ldiqual
Published on 2012-07-06T17:26:07Z Indexed on 2012/07/08 15:16 UTC
Read the original article Hit count: 197

Filed under:
|

I want to develop a program that relies on plugins (here: loadable bundles) to work. Multiple plugins are asked to use the same AFNetworking ressource to make network requests. However, I don't know where to put AFNetworking and CustomPluginProtocol headers.

Here is how my program structure looks like for now:

MyApp.xcodeproj
  - AFNetworking
    - Header.h
  - Plugins
    - Plugin1.xcodeproj
      - PrincipalClass.m
    - Plugin2.xcodeproj
      - PrincipalClass.m
  - Classes
    - CustomPluginProtocol.h
    - MainClass.m

Of course, every principalClass from PluginN complies to the CustomPluginProtocol.

  • Do the headers have to be copied in each bundle ?
  • Can I just include the main program AFNetworking headers from my plugins ? If so (and that's what I do for now), I don't have any completion. How can I get it ?

Edit

Ok, so maybe I wasn't clear in my question.

I want my plugins to use sources from the main application, let's say CommonClass.m and CommonClass.h. Do the plugins need CommonClass.h in their bundle, and if not, how do I enable completion when I'm in the plugin scope ?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about nsbundle