I am developing an objective-c framework based on Cocoa touch, and I am looking at other data analysis frameworks for both JSON and XML.
I want the developer to be as simple as using my framework out of the box, and I wonder how best to enable third-party frameworks conditionally. I want to give credit because I don’t want to include other projects in the distribution, but I would like the developer to be able to add a framework (or even just a bunch of classes), for example, SBJson or Tap XML and get my code base to see the included base code and use it with the added functionality that it provides. Enabling the framework through some configuration file or in the project settings is also an option, but not ideal.
What is the best way to do this with compiler settings? I have seen many developers switch the included framework from “Required” to “Optional”, but I don’t think SBJson or Touch XML are compiled or implemented using objective-c wireframe package (.framework) or C (. a) and thus will not be able to take advantage of this.
How to conditionally implement this in code? For example, the SBJson header is imported using the #import "SBJson.h" compiler #import "SBJson.h" , but this will fail if the required header is not found.
source share