Objective-C static, extern, public variables

后端 未结 5 2198
悲哀的现实
悲哀的现实 2020-12-12 12:14

I want to have a variable that I can access anywhere by importing a header file but I also want it to be static in the sense that there is only one of them created. In my .

5条回答
  •  温柔的废话
    2020-12-12 12:47

    If LogStuff is a static class field, maybe you can implement static getter and setter?

    + (void)setLogStuff:(BOOL)aLogStuff;
    + (BOOL)logStuff;
    

提交回复
热议问题