我正在使用 xcode 4.6,并且已将 iOS 部署目标设置为 4.3。当我在 iOS 模拟器 6.1 中构建和运行时,我能够导航到下一个 viewController。但是,当我为 iOS 5.0 或 5.1 构建和运行时,单击按钮时没有任何反应。有人对此有解决方案吗?在我的代码中看不到任何错误。这是一个普遍的问题吗?
我用过
NSString *emailRegEx = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegEx];
if([self.emailTextField.text isEqualToString:@""] && [self.phoneNumberTextField.text isEqualToString:@""])
{
UIAlertView *view = [[UIAlertView alloc] initWithTitle:@"Can't login" message:@"Email id as well as phone number is missing. Please mention atleast one info." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[view show];
}
else if([emailTest evaluateWithObject:emailTextField.text] == NO)
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Can't login" message:@"Please enter a valid email id" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}
else
{
UIViewController *profileVc = [[ProfileViewController alloc]init];
[self.navigationController pushViewController:profileVc animated:YES];
//[self presentViewController:profileVc animated:YES completion:nil];
}
在IBAction