假设您需要为一系列不同的对象设置一系列复杂配置。 这个配置可以是 NNSString 服务服务器地址, NNSNOD 像超时等等。 我想施加以下限制 :
- Configuration must not be visible and/or editable to user so plist in the app bundle is not an acceptable solution
- I need different configuration value for debug, AdHoc or release target (I will likely achieve this with a series of #ifdef but i write for sack of completeness)
- All the object that i want to configure belongs to a Static Library and i want to inject the configuration from the code that use this static library (inject is in italic as my personal hint to a dependency injection)
我的问题是:实现这一点的最佳途径是什么?你曾经遇到过这样的问题吗?你是如何解决的?