Is there a way to make one (1) instance of an object and share that instance between different files?
For instance, I have Class “A” (created in fileA.m), and I create an instance of it in a different file (fileB.m). Now, I want to use that same instance created in fileB.m in several other files (fileC.m and fileD.m) so I can share ivar’s (such as a database).
How do I do that?
You would want Class A to be a singleton. Here’s a great guide to help you out with that.