Newb Question re Messaging and Return Values
Newb Question re Messaging and Return Values
- Subject: Newb Question re Messaging and Return Values
- From: Brad Gibbs <email@hidden>
- Date: Thu, 24 Jul 2008 11:00:45 -0700
I'm having a hard time understanding return values and maybe messaging
in general. I've looked through Programming in Objective-C, Hillegass
Third Edition and through Apple's documentation, but don't seem to
know enough to find the answer or a proper example I can implement.
I have a view controller that handles button presses, tracks variables
and updates button states and text fields for a number of devices
represented on the UI. A button press
- (IBAction)statusQuery:(id)sender;
sends a message from the view controller to an object named device.
The device object has a method
- (NSString *)statusQuery {
[webServer getVariableValueByName:@"status"];
}
webServer is an instance of a class that handles HTTP Posts to a web
server on my local network via NSURLConnection. This is working well
and webServer is getting the expected responses and logging them to
the console. But, I can't figure out how to send the response string
from the connectionDidFinishLoading method of the webServer object
back to the device's statusQuery method, which needs to parse the
response and send the parsed response back to the view controller to
update the UI.
I'm hoping for a generic message that can send any response back to
any object that invokes the NSURLConnection method.
connectionDidFinishLoading is set to return (NSString *). Is it
possible to have the delegate method connectionDidFinishLoading send
its response back to the object that invoked the NSURLConnection
request? If so, what is the proper syntax?
Thanks.
Brad
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden