如何在 ios 中使用不同的 api 在调试模式和发布模式下运行应用程序 [英] How to run application in debug mode and release mode with different api's in ios
问题描述
请帮我解决这个问题.我必须在调试模式下运行我的应用程序,一个 api 开始,在发布模式下我必须运行另一个 api.
Please help me with this issue.I have to run my application in debug mode with one api starting with and in release mode I have to run another api starting with.
在调试模式下我使用这样的 api http://def.info/api/homeapi/Login 并且在发布模式下我应该使用像 http://abc.info/api/homeapi/登录.如果我想在发布模式或调试模式下运行,我正在根据那个更改我的所有 api.但我知道这不是正确的做法.请帮帮我.
In debug mode I use like this api http://def.info/api/homeapi/Login and in release mode I should use like http://abc.info/api/homeapi/Login.If I want to run in release mode or debug mode I'm changing all my api's according to that. But I know this is not the correct way to do. Please help me.
推荐答案
我们来试试:
#ifdef DEBUG
#define LINK_API @"LINK THAT YOU WANT"
#else
#define LINK_API @"LINK THAT YOU WANT"
#endif
这篇关于如何在 ios 中使用不同的 api 在调试模式和发布模式下运行应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!