i am making an app in which user’s data is send to a server…the data should be in xml format.
presently i have made a string and put all into it…like following format
NSString *s=[[NSString alloc]initWithFormat:@”%@%@”,name.text,address.text];
(this is just an example i have made a string with full xml tags including xml version tag)
and then send this through http post method….
i did it but dont know how to get response of server…please help …any code will be helpful…..
waiting for answer
Take a look at NSURLConnection. You essentially create a connection, register a delegate, kick off the request and build the response as the data is passed to your delegate.
I’m working from memory here, but essentially:
The request will be made, and the response will be passed back to your delegate in:
I’ve not tested this, but something like:
Then in your delegate you can build the response using the data provided in the didReceiveData:(NSData *)data and didReceiveResponse:(NSURLResponse *)response methods.