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 ...
随机推荐
- POJ 1860 Currency Exchange
题意:有n种货币,可以互相兑换,有m个兑换规则,兑换规则给出汇率r和手续费c,公式为b = (a - c) * r,从a货币兑换为b货币,问能不能通过不断的兑换赚钱,兑换期间手中的钱数不可以为负. 解 ...
- 浅谈Linux容器和镜像签名
导读 从根本上说,几乎所有的主要软件,即使是开源软件,都是在基于镜像的容器技术出现之前设计的.这意味着把软件放到容器中相当于是一次平台移植.这也意味着一些程序可以很容易就迁移,而另一些就更困难. 我大 ...
- IOS GCD
UIButton * btn = [[UIButton alloc]initWithFrame:CGRectMake(100, 100, 100, 100)]; [btn setTitle:@&quo ...
- C++第一章概述
1:C++主要是对于C的继承性做的相当的出色,主要扩充在于程序员可以自己定义自己的数据结构,用数据结构去描述日常生活中的事务,而不是C语言中当当仅有的Struct数据类型等等 2: 每一种语言都有自己 ...
- springmvc基础知识
springmvc框架,类似于struts,主要用于MVC的控制层 spring的简单配置(非注解): spring-mvc.xml文件(springMVC框架的基本文件) web.xml文件 ja ...
- 数字图像处理-----主成成分分析PCA
主成分分析PCA 降维的必要性 1.多重共线性--预测变量之间相互关联.多重共线性会导致解空间的不稳定,从而可能导致结果的不连贯. 2.高维空间本身具有稀疏性.一维正态分布有68%的值落于正负标准差之 ...
- Maven解决Missing artifact com.sun:tools:jar:1.5.0错误
<dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> ...
- 树莓派I2C连接18B20
按图连接设备 载入模块 sudo modprobe w1-gpio sudo modprobe w1-therm cd /sys/bus/w1/devices/ 显示结果 ls pi@raspberr ...
- 【Spark学习】Apache Spark监控与测量
Spark版本:1.1.1 本文系从官方文档翻译而来,转载请尊重译者的工作,注明以下链接: http://www.cnblogs.com/zhangningbo/p/4137952.html
- 【Hadoop代码笔记】Hadoop作业提交之Child启动reduce任务
一.概要描述 在上篇博文描述了TaskTracker启动一个独立的java进程来执行Map任务.接上上篇文章,TaskRunner线程执行中,会构造一个java –D** Child address ...