Global constants in Objective-C

前端 未结 3 2034
春和景丽
春和景丽 2021-01-05 02:54

I\'ve a file called Constants.h:

extern NSString * const BASE_URL;

and Constants.m:

#ifde         


        
3条回答
  •  有刺的猬
    2021-01-05 03:44

    #define DEBUG 1 or 0 to disable.

    The error is because you are calling a method of NSString while its a compile constant. In other words you are telling the compiler something it simply can't handle. You will need to initialize such a dynamic link on launch, the compiler can't do this for you.

提交回复
热议问题