我在点击 UIbutton 时显示 UIActionSheet。
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"Clock" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Start",@"Reset",nil];
[actionSheet setTag:1001];
[actionSheet showInView:self.view];
[actionSheet release];
我想在点击时更改第一个“开始”按钮的标题。
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
switch (buttonIndex)
{
case 0:
{
// I want to change title of first button start to stop. on clicking.
}
break;
case 1:
{
}
break;
default:
break;
}
}
需要更改开始按钮标题以停止,并在再次停止时开始。Vice Versa