![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Objective C
小小的苗儿
我是敢死冲锋队,我是谦虚小树苗儿
展开
-
OC直接获取当前系统的小时和分钟
//创建对象 NSCalendar *calendar = [NSCalendar currentCalendar];//获取小时 NSInteger hour = [calendar component:NSCalendarUnitHour fromDate:[NSDate date]];//获取分钟 NSInteger minute = [calendar compon...原创 2019-06-16 16:45:00 · 953 阅读 · 0 评论 -
OC 设定定时器,循环执行方法
NSTimer *timer = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(update) userInfo:nil repeats:YES]; [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMo...原创 2019-06-16 16:48:38 · 1729 阅读 · 0 评论 -
iOS 获取屏幕亮度和调整屏幕亮度的方法
//获取亮度[UIScreen mainScreen].brightness;//调整亮度[[UIScreen mainScreen] setBrightness:value];原创 2019-06-17 21:31:18 · 2151 阅读 · 0 评论 -
OC 如何读取plist文件
//利用mainBundle可以访问软件资源包中的任何资源NSBundle *bundle = [NSBundle mainBundle];//获得imageData.plist的全路径NSBundle *path = [bundle pathForResource:@"imageData" ofType:@"plist"];//方法arrayWithContentsOfFile需要全...原创 2019-06-17 21:30:42 · 1935 阅读 · 0 评论 -
OC 添加Button在主屏幕上,设置全屏且为灰色
//获取屏幕宽度和高度#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)//声明:@property (strong, nonatomic) UIButton *button;//初始...原创 2019-06-28 14:00:21 · 572 阅读 · 0 评论