如何在xcconfig文件中配置完整URL [英] How do I configure full URLs in xcconfig files

查看:396
本文介绍了如何在xcconfig文件中配置完整URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个xcconfig文件,其中包含我的应用应该点击的服务器的配置。在调试模式下,这将是与发布版本不同的服务器。

I have an xcconfig file which contains a configuration for which server my app should hit. In debug mode, this will be a different server than for release builds.

我遇到的问题是形式为 http://www.stackoverflow.com 在双斜线后被视为注释。所以我在代码中得到的字符串是'http:'

The problem I have is that a URL of the form http://www.stackoverflow.com is treated as a comment after the double slash. So the string I get in code is 'http:'

我已经读过我可以在Info.plist上放一个传统的构建标志,我想知道是否有其他人有一个类似的问题并解决了吗?

I have read that I can put a -traditional build flag on Info.plist, I was wondering if someone else has had a similar issue and has solved it?

谢谢。

推荐答案

这是一个简单的解决方法:

Here's a simple workaround:

WEBSITE_URL = https:/$()/www.example.com

这篇关于如何在xcconfig文件中配置完整URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆