iphone通过UIActionSheetDelegate实现警告
来源:互联网 发布:大数据 股票预测模型 编辑:程序博客网 时间:2024/05/19 00:16
在iphone程序中有一些操作需要提醒用户确实要进行,确保用户因手误删除重要数据,下面是一种警告窗口:
实现发放很简单:
- 在相应的controller的.h中添加UIActionSheetDelegate协议。如:
- 在.m中添加相应的方法即可:
@interface Stage5ViewController : UIViewController
<UIActionSheetDelegate>
-(IBAction) showActionSheetButtonPressed:(id) sender
{
UIActionSheet *actionSheet = [[UIActionSheet alloc]
initWithTitle:@”Congratulation. You have completed the elimination diet and food challenge test. Do you want to share your progress with friends?”
delegate:self
cancelButtonTitle:@”Cancel”
destructiveButtonTitle:nil
otherButtonTitles:@”Facebook”,@”Twitter”,nil ];
[actionSheet showInView:self.view];//参数指显示UIActionSheet的parent。
[actionSheet release];
}
-(void) actionSheet : (UIActionSheet *) actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex
{
switch (buttonIndex) {
case 0:
NSLog(@”facebook”);
break;
case 1:
NSLog(@”twitter”);
break;
default:
break;
}
}
- iphone通过UIActionSheetDelegate实现警告
- iphone通过UIActionSheetDelegate实现警告
- iphone通过UIActionSheetDelegate实现警告
- iPhone开发秘籍--通过警告直接与用户对话
- iPhone 音频警告
- iPhone 通过多张图片实现动画
- iphone--通过UIView实现动画效果
- iPhone通过usb与windows实现通信
- 通过jquery实现覆盖全屏的警告框
- 通过hmc消除警告
- iPhone相机和内存警告
- UIActinSheet和UIActionSheetDelegate
- iPhone开发学习笔记通过UIView实现动画效果
- IPHONE通过软件实现连接投影仪的方法
- iphone模拟器上模拟内存警告
- 简单的音频警告 iphone开发
- [转载]iphone开发错误总结-警告篇
- iphone开发错误总结-警告篇
- iPhone 应用中直接连接到特定的app store应用页面
- c#操作XML文件的方法
- (转)如何解决VC6.0中win32 error267错误
- 在UINavigationController的导航栏中添加UISegmentedControl
- 三层架构的项目中通常异常的处理方式!!!
- iphone通过UIActionSheetDelegate实现警告
- JS中的信息提示框
- 在MkMapView中添加自己当前位置的大头针
- 【转贴】一个10年程序员职业发展、总结和困境
- 利用MKMapView显示自己当前位置的地图
- 清除(设置)eclipse的workspace记录
- ios利用MKMapView实现简单的地图
- 二叉树的构建与遍历
- UITableView cell自定义视图中插入Table实现复杂界面