How do I access an object that was created in another class. I have one class that constructs a web query goes online and pulls the data back. This results in an object that has all of the information I need. I want to be able to get the state of various variables in that object. The object probably won't change after creation
Why don't you have a method on the "other" class that constructs the query, pulls the data back and returns the object with the data?
I'm not sure what you are asking here as I don't understand your question exactly.
If you mean you are trying to access variables in another object, use the following syntax:
object->varName;
Methods on an object are called using the following syntax:
[object methodName];
You need to know what class an object is an instance of, in order to find out what variables or methods are available to use.
When you want to pass an object back to the function you used to initiate the web query, use:
return object;
Classes aren't departments; they're the code behind objects. You have information in one object, and another object that needs to access this information.
I think you should look to Cocoa's MVC definition for guidance. Decide which role each of these classes serves. If a class doesn't seem to serve any of them, you probably have some redesigning to do.
Once each class is firmly a Model, View, or Controller, the communication flow between them should be more clear to you.