首页 > 其他 > 详细

一些常用的小控件的整理

时间:2015-06-24 09:18:57      阅读:252      评论:0      收藏:0      [点我收藏+]

1.时间控制器   但是需要注意只能在主线程中使用 

[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(logBtnClick) userInfo:nil repeats:YES];

2.延迟调用

[self performSelector:@selector(logBtnClick) withObject:self afterDelay:1];

3.直接给睡10秒钟再说

[NSThread sleepForTimeInterval:10.0];

 

4.UIAlertView 这个控件是有代理函数的  UIAlertViewDelegate   但是只需要在头部引用就可以了   而不需要像大部分代理一样去特定遵守

   UIAlertView *av=[[UIAlertView alloc]initWithTitle:@"提示" message:message delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"返回", nil];

    [av show];

他的代理函数作用就是实现弹出各个按钮的点击事件

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex

{

    switch (buttonIndex) {

        case 0:

            NSLog(@"点击确定了");

            break;

        default:

            NSLog(@"点击返回了");

            break;

    }

}

 

一些常用的小控件的整理

原文:http://www.cnblogs.com/huketianxia/p/4596786.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!