I will try to make this question as understandable as possible. I am implementing core data in my app, and I need to access the NSManagedObjectContext
from around 10,000 different instances of a class (this class extends UIView
). The Core Data stores what is displayed on these instances and the class builds it.
Everything that I have found so far uses View Controllers, of which you only have one instance, so you can just alloc init
the VC in AppDelegate
, set an @property
for NSManagedObjectContext
and be on your way. This does not work for my program.
What I want to do is have many instances of my CoreDataHelper
class (which I will alloc init
in the class that I have around 10,000 instances of, which all have a property pointing to the same NSManagedObjectContext
. Is this a possible way to do it or will I have to make my program less flexible by moving all of the code to create the 10,000 different objects to the View Controller
?