I want to define a macro globally. I want to override NSLocalizedString()
throughout my whole project. Is that possible and how do I do it?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Declare the macro in the #ifdef __OBJC__
section of your AppName-Prefix.pch.
回答2:
You define your macro in some header file. You place this header file in *.pch
file (prefix header file). Search for "prefix" in build settings for your target. Make sure your *.pch
file is used.