对于这种情况,删除以编程方式创建的按钮的代码是什么,例如:
for (m=0; m<f;m++ )
{
numerodeboton=partenumero+m+1;
//NSLog(@"crear boton2, %i", numerodeboton);
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setBackgroundImage:[UIImage imageNamed:@"boton.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(notasCurso)forControlEvents:UIControlEventTouchUpInside];
[button setTitle:[NSString stringWithFormat:@"Botón %d", numerodeboton] forState:UIControlStateNormal];
button.frame = CGRectMake(espacioh+m*(h+d)-z + h/2, y + (l-1)*(v+d) + v/2, 1, 1);
button.layer.cornerRadius = 30;
button.clipsToBounds = YES;
button.layer.borderColor=[UIColor blackColor].CGColor;
button.layer.borderWidth=0.01f;
[button setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
button.tag = numerodeboton;
[UIView animateWithDuration:0.05*numerodeboton animations:^{
button.frame = CGRectMake(espacioh+m*(h+d)-z, y + (l-1)*(v+d), h, v);
}];
[self.view addSubview:button];
}
假设我想删除带有 的按钮tag = 3
,代码是什么?