ios UIAlertView展示
-(void)showalert{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:[NSString stringWithFormat:@"\n%@", @"是否确定购买?"] delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"投资", nil]; alert.tag = 1024; [alert show]; }
代理:UIAlertViewDelegate
#pragma mark - UIAlertViewDelegate - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (1024 == alertView.tag) { if (buttonIndex == 0) { return; } [self invstBtnAction:nil]; } }