I have the following issue. I have two classes that manipulate information but they are completely disconnected, i.e. I can’t reach the other class.
I need both classes to use a certain value. For example, class A sets the value foo = A and class B needs to be able to read that value and rest foo to nil.
I thought about creating the variable in the main app delegate, but can’t figure out how.
Ideas?!!
Global variables are generally bad idea. Based on your description i think you can use KVO to inform class B about the changes in ‘foo’.
But if you relly need a global variable you can do this: