// 当我单击按钮时,我希望出现一个警报视图,然后输入登录详细信息,如果详细信息正确,则移动到下一个视图,否则不。这该怎么做 ?
// 现在,当我单击按钮时,myButton 方法结束时会出现警报视图。如何控制流量?
- (IBAction)myButton:(id)sender
{
flag= [self alertview];
if (flag)
{
SecondViewController *svc =[self.storyboard instantiateViewControllerWithIdentifier:@"vinay"];
[svc setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentViewController:svc animated:YES completion:nil];
}
}
-(int)alertview
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Login"
message:[NSString stringWithFormat:@"Enter Login ID and Password:"]
delegate:self cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
flag=1;
[alert setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];
[alert show];
return flag;
}