It depends on how you want to send data to the web server. If you just want to use the HTTP POST method, there are (at least) two options. You can use synchronous or asynchronous NSURLRequest. If you want to send messages only and do not need to wait for a response from the server, I highly recommend asynchronous, since it does not block the user interface. That is, it starts "in the background", and the user can continue to use (which interacts) with your application. Asynchronous requests use delegation to inform the application that the request has been sent, canceled, completed, etc. You can also get an answer through delegate methods, if necessary.
Here is an example of an asynchronous HTTP POST request:
NSString *content = @"field1=42&field2=Hello";
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.example.com/form.php"]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setHTTPBody:[content dataUsingEncoding:NSISOLatin1StringEncoding]];
[NSURLConnection connectionWithRequest:request delegate:self];
. NSURLConnection.
:
[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSURLResponse ** , , . , .