How do I reference a pointer from a different class?
Posted
by Justagruvn
on Stack Overflow
See other posts from Stack Overflow
or by Justagruvn
Published on 2010-06-17T22:36:30Z
Indexed on
2010/06/17
23:03 UTC
Read the original article
Hit count: 154
First off, I despise singletons with a passion. Though I should probably be trying to use one, I just don't want to. I want to create a data class (that is instantiated only once by a view controller on loading), and then using a different class, message the crap out of that data instance until it is brimming with so much data, it smiles.
So, how do I do that? I made a pointer to the instance of the data class when I instantiated it. I'm now over in a separate view controller, action occurs, and I want to update the initial data object. I think I need to reference that object by way of pointer, but I have no idea how to do that. Yes, I've set properties and getters and setters, which seem to work, but only in the initial view controller class.
Peace Love applesauce.
© Stack Overflow or respective owner