UIボタンのタップで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;
}
}
開始ボタンのタイトルを変更して停止し、停止したときに再び開始する必要があります。その逆