Displaying Alerts with UIAlertView
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Alert"
message:@"You've been delivered an alert"
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Ok", nil];
[alertView show];
self.view.backgroundColor = [UIColor whiteColor];
NSString *message = @"Are you sure you want to open this link in Safari?";
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Open Link"
message:message
delegate:self
cancelButtonTitle:[self noButtonTitle]
otherButtonTitles:[self yesButtonTitle], nil];
[alertView show];
more samples
// one button alert
UIAlertView *alert =
[[UIAlertView alloc]
initWithTitle: @"Hello"
message: @"Hello Master HaKu!"
delegate: self
cancelButtonTitle: @"OK"
OtherButtonTitles: nil];
[alert show];
[alert release]; // two buttons alert
UIAlertView *alert =
[[UIAlertView alloc]
initWithTitle: @"Hello"
message: @"Hello Master HaKu!"
delegate: self
cancelButtonTitle: @"YES"
OtherButtonTitles: @"NO", nil];
[alert show];
[alert release]; // more buttons alert
UIAlertView *alert =
[[UIAlertView alloc]
initWithTitle: @"Hello"
message: @"Hello Master HaKu!"
delegate: self
cancelButtonTitle: @"OK"
OtherButtonTitles: @"Option1", @"Option2", nil];
[alert show];
[alert release]; @interface AlertTestViewController : UIViewController<UIAlertViewDelegate> @end // alert click implmentation
- (void) alertView: (UIAlertView *)alertView
clickedButtonAtIndex: (NSInteger)buttonIndex
{
NSLog(@"%d", buttonIndex);
}
Displaying Alerts with UIAlertView的更多相关文章
- Cannot find executable for CFBundle 解决办法
出错日志为:2013-12-29 01:17:49.785 Displaying Alerts with UIAlertView[419:70b] Cannot find executable for ...
- 开始使用 UIAlertController 吧
UIAlertView 与 UIActionSheet UIAlertView 样式 实现 - (void)showAlertView { self.alertView = [[UIAlertView ...
- learning shell display alert function
[Purpose] Shell print function base on err info wrn ext output level [Eevironment] U ...
- IOS Using UIAlertView to show alerts
UIAlertView in other words, it's a dialog box. You want to show a message or ask user to confirm an ...
- UIAlertController (UIActionSheet, UIAlertView is deprecated in iOS 8.)
iOS 8 后 UIAlertView 和 UIActionSheet 都被合并到了 UIAlertController里面. 文档原文: Important: UIAlertView is dep ...
- [Swift]UIKit学习之警告框:UIAlertController和UIAlertView
Important: UIAlertView is deprecated in iOS 8. (Note that UIAlertViewDelegate is also deprecated.) T ...
- iOS 8及以后版本 如何创建UIAlertView?
1. Important: UIAlertView is deprecated in iOS 8. (Note that UIAlertViewDelegate is also deprecated. ...
- iOS8以后UIAlertView和UIActionSheet两种alert页面都将通过UIAlertController来创建
1. Important: UIAlertView is deprecated in iOS 8. (Note that UIAlertViewDelegate is also deprecated. ...
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
本文转载至 http://blog.csdn.net/liuwuguigui/article/details/39494597 IOS8UIAlertViewUIActionSheet ...
随机推荐
- java文件过滤器
java中有一个FilenameFilter的接口,能够过滤得到指定类型的文件或者目录,其中必须重写accept(File file,String path)方法 public class DirFi ...
- 有关T-SQL的10个好习惯(转)
1. 在生产环境中不要出现Select * 这一点我想大家已经是比较熟知了,这样的错误相信会犯的人不会太多.但我这里还是要说一下. 不使用Select *的原因主要不是坊间所流传的将*解析成具体的列需 ...
- HDU-3001 Travelling
http://acm.hdu.edu.cn/showproblem.php?pid=3001 从任何一个点出发,去到达所有的点,但每个点只能到达2次,使用的经费最小.三进制 Travelling Ti ...
- 仿酷狗音乐播放器开发日志二十七 用ole为窗体增加文件拖动功能(附源码)
转载请说明原出处,谢谢~~ 中秋到了,出去玩了几天.今天把仿酷狗程序做了收尾,已经开发完成了,下一篇博客把完结的情况说一下.在这篇博客里说一下使用OLE为窗体增加文件拖拽的功能.使用播放器,我更喜欢直 ...
- 【Linux学习】 写一个简单的Makefile编译源码获取当前系统时间
打算学习一下Linux,这两天先看了一下gcc的简单用法以及makefile的写法,今天是周末,天气闷热超市,早晨突然发现住处的冰箱可以用了,于是先出去吃了点东西,然后去超市买了一坨冰棍,老冰棍居多, ...
- [Hive - LanguageManual] DML: Load, Insert, Update, Delete
LanguageManual DML Hive Data Manipulation Language Hive Data Manipulation Language Loading files int ...
- 用java获取歌曲文件的专辑封面元信息
几个个软件: 1, Jaudioatgger: 链接 2, mp3agic 链接 3, Java mp3 id3 tag library (推荐用上面两个) 其它: android-midi-lib
- linux高级数据存储
linux内此存储模式由5部分组成,自低向上的顺序: 物理卷,内核块设备驱动,内核文件系统驱动,虚拟文件系统,应用程序数据结构; 系统中所有的文件仅按此模式存储,无论是数据还是元数据,均在此模式下统一 ...
- java出现no XXX in java.library.path的解决办法及eclipse配置
java一般使用两个path:classpath 和 java.library.path classpath是指向jar包的位置 java.library.path是非java类包的位置如(dll,s ...
- Java缓存学习之二:浏览器缓存机制
浏览器端的九种缓存机制介绍 浏览器缓存是浏览器端保存数据用于快速读取或避免重复资源请求的优化机制,有效的缓存使用可以避免重复的网络请求和浏览器快速地读取本地数据,整体上加速网页展示给用户.浏览器端缓存 ...