Is it possible to send text from an xcode input and have the data sent through a php function?
A:
If you actually want to do this using simple Objective-C (Foundation) classes, you should use NSURLConnection. Example:
NSString * post = [[NSString alloc] initWithFormat:@"&myvariable=%@", myString];
NSData * postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:NO];
NSString * postLength = [NSString stringWithFormat:@"%d",[postData length]];
NSMutableURLRequest * request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.yoursite.com/file.php"]]];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
NSURLConnection * conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (conn) NSLog(@"Connection Successful");
Cappuccino Plus Plus
2010-09-20 02:44:00