If you want to send text information to the server, you can try this code:
NSString *textdata = [YourTextField text]; NSString *anotherTextdata = [YourAnotherTextField text]; NSString *urlpath; urlpath = [@"http://yoursiteapiurl.com/" stringByAppendingString:@"yourserverfile.php?textdata="]; urlpath = [urlpath stringByAppendingString:textdata]; urlpath = [urlpath stringByAppendingString:@"&anotherTextData="]; urlpath = [urlpath stringByAppendingString:anotherTextdata]; NSURL *url=[[NSURL alloc] initWithString:[urlpath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSString *a = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
Variable a will have the response of this url. The server can send XML, and then you can parse this XML using any XML parsing method.
source share