我们在开发过程中,往往需要使用几种域名。手动修改比较麻烦,我们可以通过配置多种Build configuration,编译的时候通过选择不同的环境来实现自由切换。
1. 找到PROJECT 》Info 〉Configuration,添加配置

2.找到PROJECT》Build Settings〉搜索Preprocessor Macros, 添加你要添加的环境

3.找到找到PROJECT》Build Settings〉搜索Custom Flags, 进入修改,如下图

4.最后就可以在product》scheme〉edit scheme里面进行选择

运行一下,看看最后是不是对的
网友评论