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

前端 未结 4 1170
小鲜肉
小鲜肉 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:34

    The AppDelegate approach should work, and you should probably figure out why it's not working, even if you go with a singleton.

    The statement to get your appDelegate pointer appears to be correct, so I'm guessing that the pointer to the array is either not getting set (and retained) in your myappDelegate class, or you did not create the AppDelegate instance correctly in the first place.

提交回复
热议问题