开发者

Sharing integer values among tab bar controllers

开发者 https://www.devze.com 2023-03-10 06:07 出处:网络
In my iOS app I have a main window with a tab bar. Each tab has its own controller, so I have开发者_如何学C multiple .m files. How can I obtain int values from each of these .m files and display them

In my iOS app I have a main window with a tab bar. Each tab has its own controller, so I have开发者_如何学C multiple .m files. How can I obtain int values from each of these .m files and display them in a different tab (separate .m file)?

Can int values be called globally?

I would like to display all of these different values on one page as an overview.


Don't use global variables for this. Either save the ints using NSUserDefaults, or send them using NSNotificationCenter.

0

精彩评论

暂无评论...
验证码 换一张
取 消