UIActionSheet 是弹出一个事件选择框
相关api:
实现UIActionSheetDelegate协议的- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex; 方法
根据不同的动作选项来处理事件,代码(arc) 如:
if (buttonIndex != actionSheet.cancelButtonIndex) {
UIAlertView *alert;
alert = [[UIAlertView alloc]initWithTitle:@"清空操作" message:@"清空用户名和密码" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert show];
}
UIAlertView 是一个对话框
代码:(arc)
UIAlertView *alert;
alert = [[UIAlertView alloc]initWithTitle:@"清空操作" message:@"清空用户名和密码" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert show];