Mach-o Linker Error

前端 未结 2 1921
醉话见心
醉话见心 2021-01-24 03:11

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 m

2条回答
  •  温柔的废话
    2021-01-24 03:39

    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.

提交回复
热议问题