I can't build my project because I keep getting this error. As I understood it deals with the constant tagShift I'm using in my code. I would appreciate if anyone could help me to solve this issue
Asked
Active
Viewed 99 times
1

AOY
- 355
- 3
- 22
2 Answers
1
I had faced the same issue someday and figured out the result as:
Here You have a int tagShit
of constant type. So you can not make constant type variables of same name in two or more classes. Change that tagShit
variable name in one of the class (may be as tagShift1 or anything else) and it will be good to go.
Hope it'll help you.

M Zubair Shamshad
- 2,741
- 3
- 23
- 45
-
I tried to create a new constant with a different name for each new class. And now I've got duplicateSymbol for tagShiftP and tagShiftV =) – AOY Jun 12 '15 at 11:52
-
The error doesn't show up only when I insert a number instead of that constant. But writing everything by hand isn't isn't the best solution as I just wanted to have one constant to be visible in different classes. – AOY Jun 12 '15 at 11:58
-
I'll try to do it now – AOY Jun 12 '15 at 11:58
-
1No you cannot create a same name constant in different classes. – M Zubair Shamshad Jun 12 '15 at 12:01
-
Thank you. You really helped me – AOY Jun 12 '15 at 12:05
-
I will surely do that when I'll get a 15 raiting)) It's only 12 now and I can't wote( – AOY Jun 12 '15 at 12:12
0
I guess you have included TrafficLightG.h in more than one file.
#include "TrafficLightG.h"
Declare your const in that way:
TrafficLightG.h
const int tagShift;
TrafficLightG.m
const int tagShift = 90;
PS: use NSInteger or NSUInteger instead of int.

Apoc
- 797
- 1
- 10
- 15