我在这个程序中哪里错了
else if
{
NSString *post =
[[NSString alloc] initWithFormat:@"username=%@ & password=%@",usernameTxt,passwordTxt];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
NSURL *url = [NSURL URLWithString:@"http://192.168.10.28:5000/wsserver.php"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
[theRequest setHTTPMethod:@"POST"];
[theRequest setValue:postLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPBody:postData];
connection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if(connection )
{
webData = [[NSMutableData alloc]init];
//[self alertStatus:@"u r connected with web services " :@"connected!"];
if ([usernameTxt.text isEqualToString:@"username" ]&&[passwordTxt.text isEqualToString:@"password"])
{
NSLog(@"u have move to sns");
}
}
else
{
[self alertStatus:@"connection failed" :@"connection Failed!"];
}