我正试图对警报上按下的任何按钮进行操作。我有下面的代码和第一个警报弹出窗口,但它永远不会到第二个。UIAlertView问题
我已经设置了它,以便在标题中定义UIAlertViewProtocol。
-(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if(buttonIndex != [actionSheet cancelButtonIndex])
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Something actually happened" message:@"Something was done" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"test",nil];
[alert show];
}
}
-(void)alert:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex ==0)
{
NSLog(@"tetetete");
UIAlertView *a = [[UIAlertView alloc] initWithTitle:@"test" message:@"test" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[a show];
[a release];
[alert release];
}
}