我在下面的代码中有“未使用的变量”警告。最后一节,变量conn是未使用的变量。我试试吧 “[NSURLConnection initWithRequest:request delegate:self];” 但没有工作。 Any1可以帮助我吗?
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@""http://someaddress.com/webservice.php"]];
request.HTTPMethod=@"POST";
[request setValue:@"application/x-www-form-urlencoded; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
NSString *stringData = [NSString stringWithFormat:@"kod=%@",nickiminKodu];//posting parameters
NSData *requestBodyData = [stringData dataUsingEncoding:NSUTF8StringEncoding];
request.HTTPBody = requestBodyData;
NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];