Gopik
Gopik

Reputation: 255

Xcode 8 preprocessor Macros?

I am working with multiple targets in Xcode 8.2, Everything is good except handling files.

To import files, I have used different pch for each target but facing issues in using different class files.

How to work with other target files in the source, it throws an error on build app. When I try to add Preprocessor Macros in Build Settings but I can't find the Preprocessor Macros section in Xcode 8. Is there any alternative to this? please suggest some other approaches to handle different target files in the same source.

Thanks in Advance.

Upvotes: 1

Views: 1373

Answers (1)

Gyanendra
Gyanendra

Reputation: 361

Select the target and go to build setting.

There search for "Preprocessor Macros" you will be able to find out. Set the macros for particular target.

Use #ifdef in the code to check whether macros is defined or not, based on macros definition write the code for specific target. That particular code will be reflected to that target only.

Upvotes: 1

Related Questions