0
Я создаю имя пользователя и пароль с помощью кнопки входа в систему. Когда я ввожу неправильный пароль, появляется предупреждающее сообщение. Но оно также переходит к следующим страницам. Коды ниже:пароль ошибки также переходит на следующую страницу в xcode 5
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
_myDict=[[NSDictionary alloc]initWithObjects:[NSArray arrayWithObjects:@"alex",@"aliv", nil] forKeys:[NSArray arrayWithObjects:@"123",@"ece", nil]];
}
- (IBAction)loginbtn:(id)sender {
[self performSegueWithIdentifier:@"segue1" sender:self];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"segue1"]) {
checkviewcontroller *dest1 = segue.destinationViewController;
}
}
и
-(BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender {
if ([identifier isEqualToString:@"segue1"]) {
if([[self.myDict objectForKey:_text2.text]isEqualToString:_text1.text]){
UIAlertView *myAlert=[[UIAlertView alloc]initWithTitle:@"ALERT MESSAGE" message:@"correct Password" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];
[myAlert show];
}
else{
UIAlertView *myAlert=[[UIAlertView alloc]initWithTitle:@"ALERT MESSAGE" message:@"Verify your Password" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];
[myAlert show];
}
return NO;
}
return YES;
}
yes.I changed.still ошибка passwor –
еще ошибка PWD переходит к следующему page.how я могу избежать этого? –