我UIAlertView
为一个动作创建了一个,它给了我 2 个选项。我希望用户能够单击一个按钮并让它执行 Segue。
这是我到目前为止的代码:
- (IBAction)switchView:(id)sender
{
UIAlertView *myAlert = [[UIAlertView alloc]
initWithTitle:@"Please Note"
message:@"Hello this is my message"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Option 1", @"Option 2", nil];
[myAlert show];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
NSString *buttonTitle = [alertView buttonTitleAtIndex:buttonIndex];
if ([buttonTitle isEqualToString:@"Option 1"]) {
}
}