Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在将 FlurryAPI 与我的应用程序集成,并且我不希望它在我运行测试时启动链接。但是,由于它在 AppDelegate 中,我想它会在我启动验收测试应用程序时运行。我正在使用 UISpec,我想知道:
有什么方法可以排除在 UISpec 中运行的代码,但仍在正常目标中运行?
我对 UISpec 不熟悉,但是如果您有 2 个不同的目标,并且您想在一个中包含代码而不是另一个,那很容易做到。
#ifndef UISPEC (code to run in any target except UISpec target) #endif
然后只需添加-DUISPEC到UISpec 目标构建设置中的Other C Flags即可。
-DUISPEC