如何在目标C中的函数调用之间使用共享数组 [英] How to use shared array between function calls in objective C
本文介绍了如何在目标C中的函数调用之间使用共享数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个数组. 我希望该数组在单个类函数的函数调用之间保留其值.
I have one array. I want that array to retain its value between function calls of from single class function.
我有每次加载页面时都会调用的函数.
I have function that is called every time page is loaded.
此功能可在应用程序启动后立即显示存储在数组中的所有数据.
This function displays all the data stored in array right from application launches.
谢谢.
推荐答案
您可以将数组存储在appDelegate类中.或者我认为最好创建一些类来存储共享数据,并在您的appDelegate中创建此类的实例.
You can store your array in appDelegate class. Or I think it will be better to make some class to store shared data and make an instance of this class in your appDelegate.
这篇关于如何在目标C中的函数调用之间使用共享数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文