Is there a way to have a settings bundle ONLY in the debug version of my app?

风格不统一 提交于 2019-12-11 12:04:44

问题


For production all users of my app will point at the production URL but for dev we have multiple developers and I want to create a settings bundle so the other devs can easily reconfigure their ios devices to point at their own machines. Is there a way to only have the settings bundle in the debug (aka non production) version of the app?


回答1:


I wrote a wrapper for the NSUserDefaults. In my app delegate I check compiler flags to see if we are in release or debug mode and set the default to the testing vs production environments. Then I use those same compiler flags in my logon view controllers to display/hide a button that allows our test users to select from the different enviroments that are provided via a plist I've included in the build.

So the answer is - Compiler Flags to set the default values, and debug enabled interface prompts to set developer specific values.



来源:https://stackoverflow.com/questions/8805359/is-there-a-way-to-have-a-settings-bundle-only-in-the-debug-version-of-my-app

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