I have a defines.h file with following code
typedef enum AnswerType : NSUInteger {
kAnswerTypeNotResponded = 0,
kAnswerTypeYes = 1,
kAnswerTypeNo = 2,
kAnswerTypeComplain = 3
} AnswerType;
When I import this file in several other files - I get an error
ld: 13 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I need AnswerType be visible in many places. What is the best variant to implement it?
Your enum looks fine. However, I guess there should be another problem.
One of the major reason for occurrence of this issue is that you might have a file listed in build phases more then once. So you need to make sure that files are listed in build phases only once.
Here are the steps you can follow: