posted 12 years ago
The best way to do that is to pass the Object from one class to another. So if you make an instance of Class2 inside Class1, you might do this:
If Class1 doesn't know about Class2, but Class2 knows about Class1 then you can use a getter method:
If Class1 doesn't know about Class2 and Class2 doesn't know about Class1, then there needs to be some controller class which knows about both. Class1 would allow others to get the ClientArray, and Class2 would be assigned the ClientArray:
Finally, if Class1 doesn't know about Class2, and Class2 doesn't know about Class1, and there is no Controller type thing which both know about, then there needs to be some shared Scope object to hold the value. Class1 would pass the value to the Scope and Class2 would take the value from the Scope.