'Xcode using per-target headers with the same name
I am using Xcode 12.4. My project builds an app with two targets, one for the Mac App Store and one for "Retail" (downloaded from my website). My project folder looks like:
-Project
--Classes
---AppStore
----MyClass.h
----MyClass.m
---Retail
----MyClass.h
----MyClass.m
---Shared
----OtherClass.h
----OtherClass.m
All six source files appear in the left side file manager of Xcode and each project has two source files, OtherClass.m and the relevant MyClass.m.
When I build, the Retail version uses the correct MyClass.m source, but when it refers to the header with #import "MyClass.h", it wants to use the header from the AppStore version. Why does Xcode not look first in the directory where the .m file is located to see if a matching .h file is in the same directory?
How can I ensure that the right header files is used for each project, especially considering that ALWAYS_SEARCH_USER_PATHS is deprecated?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
