How to use global variables in Objective-C?

前端 未结 4 687
谎友^
谎友^ 2020-12-05 10:58

How should I declare a global variable in my Objective-C project?

4条回答
  •  遥遥无期
    2020-12-05 11:09

    Globals rock! I don't know what everyone is scared of. I used them successfully here.

    Passing Data between View Controllers

    Also used UIStepper to adjust values in another viewController. I could see them being an issue is larger programs, and in my opinion the singleton thing is just a masked global. Keep it simple, if your app is simple that is.

提交回复
热议问题