Send/receive data to a server using Cocoa
Send/receive data to a server using Cocoa
- Subject: Send/receive data to a server using Cocoa
- From: Athahar <email@hidden>
- Date: Wed, 30 Aug 2006 16:54:33 +0530
Hi All
I am new to Cocoa Development.
I am trying to modify the currency converter application to work as a
client server model.
For this I have used JBoss server as the backend and I am trying to
send two inputs from the Cocoa UI to the server and get the conversion
back to the UI from JBoss.
I have been trying to achieve this by using NSURLConnection and
NSURLRequest. My code is as follows:
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL
URLWithString:@"http://145.36.149.31:8080/CBuild/servlet/HelloAddition?input1=4&input2=6"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
// create the connection with the request
// and start loading the data
NSURLConnection *theConnection=[[NSURLConnection alloc]
initWithRequest:theRequest delegate:self];
if (theConnection) {
// Create the NSMutableData that will hold
// the received data
receivedData=[[NSMutableData data] retain];
Though we are not getting any error message we cannot get any data in
the variable receivedData.
Am I missing anything here?
Please advice.
Thank you
Athahar
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden