I have some data in a database I want to retrieve as an NSArray
of custom objects, and I want this NSArray
to be static, since I need it to be referenced from a class whose methods are all class methods and I don't instantiate. I'll need to first check if this NSArray
already contains objects and, if not, get the data from the database and create it. Then, I'd need to be able to get this NSArray
from a view controller, something like NSArray *listOfItems = [MyClass getStaticArray]
, but I don't know how to handle this.
Another question related to this: what memory management implications would it have such static NSArray
?
Thanks!