【发布时间】:2012-02-18 05:00:25
【问题描述】:
我刚刚升级到最新的 4.3 Xcode。 我有我的 plist。它经过预处理,与 4.2 相比似乎不再起作用。
我设置了Info.plist other pre-processor 标志-traditional(能够跳过// 视为评论)。
我设置了
#define MYSERVER http://127.0.0.1:1234/
在我的列表中
<key>myhost</key>
<string>MYSERVER</string>
当我签入新的 Xcode 4.3 时,我看到里面有 NSDictionary *bundle = [[NSBundle mainBundle] infoDictionary];
myhost = "http:/ /127.0.0.1:1234/"
我有一个快速破解方法。
NSString *hack = [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"myhost"] stringByReplacingOccurrencesOfString:@" " withString:@""];
url = [NSURL URLWithString:hack];
这使我的应用程序再次运行,但我想要一个干净的解决方案。有什么想法吗?
【问题讨论】:
-
clang 错误中的评论说这是固定的 (llvm.org/bugs/show_bug.cgi?id=12035),但从 Xcode 7.2 开始,它对我不起作用。
-traditional的文档在这里:developer.apple.com/library/mac/technotes/tn2175/_index.html
标签: objective-c xcode plist