Quite a broad question. I'm looking to refactor an existing game app so that we have a base framework for games, which are extended with some kind of modular plugin architecture. So we have:
GameCore - lots of base classes, etc. GameBundle A/B/C... - bundles with lots of subclasses of those in the core, along with lots of resources
The game won't function at all without a concrete bundle which implements the game itself. In theory it would also be possible to break down these bundles further and mix and match. This is a very appealing design.
Using NSBundle seems to be the neatest solution, but I'm hitting some snags: The code in the GameBundle must be linked with the GameCore or it won't compile, but then when the GameCore code is loaded from the NSBundle, you get duplicates of all the core classes. This suggests that I'm way off the mark with how I'm approaching this!
This could easily be implemented with static libs, but then it's not possible to easily include resources...
So, could anyone suggest a workable architecture that would do as I wish? To summarise;
Abstract game core Indeterminate number of GameBundles added to the target, which are (ideally) loaded dynamically at runtime.
Hope someone can help!