Can i have a single NSMutableArray in my multiple views application?

前端 未结 4 1173
小鲜肉
小鲜肉 2020-12-22 09:05

I have a navigational based application which has multiple views. Is it possible to use one single NSMutableArray for the whole applicaiton? Can i add objects to that NSMuta

4条回答
  •  我在风中等你
    2020-12-22 09:14

    For your type of issue I would use a singleton.

    http://en.wikipedia.org/wiki/Singleton_pattern

    The appdelegate is a singleton too but you can reduce a bit the number of coded lines if you use your own singleton.

提交回复
热议问题