I just upgraded to the latest 4.3 Xcode.
I have my plist.which is preprocessed and compared to 4.2 does not seem to work anymore.
I set Info.plist other pre-processor flag -traditional (to be able to skip // considered as a comment).
I set
#define MYSERVER http://127.0.0.1:1234/
and in my plist
<key>myhost</key>
<string>MYSERVER</string>
When I check in the new Xcode 4.3 I see inside NSDictionary *bundle = [[NSBundle mainBundle] infoDictionary];
myhost = "http:/ /127.0.0.1:1234/"
I have a quick hack for it.
NSString *hack = [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"myhost"] stringByReplacingOccurrencesOfString:@" " withString:@""];
url = [NSURL URLWithString:hack];
This is making my app working again, but I would like to have a clean solution. Any ideas?
This is actually a bug in clang’s preprocessor which is shipped with Xcode 4.3 (clang 3.1) and it affects all preprocessing, not just Info.plists. I’ve filed a bug (LLVM bug 12035, rdar://10883862).
A workaround for this is to force Xcode 4.3 to use llvm-gcc for Info.plist preprocessing instead of clang. The only way I’ve found so far is to rewrite the “cc” symlink which is used in Info.plist preprocessing phase:
sudo ln -fs /usr/bin/llvm-gcc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ccTo revert this hack, just rewrite it back to clang:
sudo ln -fs /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc