block类似C语言的函数指针,但Blocks不是一个指针,而是一个不带名字的函数(匿名的代码块)。在这里我就不赘述了,说说将UIAlertView的按钮点击代理方式改为Block形式。代码中定义的全局变量_index与本文主要内容无关,在下一篇,我会详细说明Block的相互引用问题//控制器Vi....
分类:
其他好文 时间:
2015-09-17 13:19:02
阅读次数:
110
弹出框的使用1.实现代理UIAlertViewDelegate2.弹出框 // 弹框初始化 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"数据展示" message:nil delegate:self cancelBu...
分类:
移动开发 时间:
2015-09-16 19:34:43
阅读次数:
151
// 创建一个弹框UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@“标题” message:@“显示的具体内容” delegate:self cancelButtonTitle:@“取消” otherButtonTitle:@“确定”...
分类:
其他好文 时间:
2015-09-15 19:57:16
阅读次数:
202
//初始化警告框,并设置基本信息,设置代理 UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"标题" message:@"信息" delegate:self cancelButtonTitle:@"取消" otherButtonTitle....
分类:
其他好文 时间:
2015-09-13 14:42:13
阅读次数:
177
#import typedef void (^DismissBlock)(int buttonIndex);typedef void (^CancelBlock)();@interface UIAlertView (Blocks) + (UIAlertView*) showAlertViewWit....
分类:
其他好文 时间:
2015-09-10 00:30:32
阅读次数:
129
例子:static const char kRepresentedObject;- (IBAction)doSomething:(id)sender { UIAlertView *alert = [[UIAlertView alloc] initWit...
分类:
移动开发 时间:
2015-09-09 06:17:01
阅读次数:
179
传统的alertView- (void)alertView
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"你的操作时非法的,您要继续吗" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert...
分类:
移动开发 时间:
2015-08-30 12:58:50
阅读次数:
241
UIAlertView1.Title获取或设置UIAlertView上的标题。2.Message获取或设置UIAlertView上的消息UIAlertView*alertView = [[UIAlertViewalloc]initWithTitle:@"Title"message:...
分类:
其他好文 时间:
2015-08-28 23:07:38
阅读次数:
191
在iOS8以后,UIAlertView就开始被抛弃了。取而代之是UIAlertController以前是警示框这样写:UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请输入用户名、密码和服务器" dele...
分类:
其他好文 时间:
2015-08-28 12:27:17
阅读次数:
232
iOS8推出了几个新的“controller”,主要是把类似之前的UIAlertView变成了UIAlertController,这不经意的改变,貌似把我之前理解的“controller”一下子推翻了~但是也无所谓,有新东西不怕,学会使用了就行。接下来会探讨一下这些个新的Controller。- (...
分类:
移动开发 时间:
2015-08-25 18:55:00
阅读次数:
223