2018年9月26日

UIDatePicker设置为24小时制

摘要: self.startDateView = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, screenHight - 300, screenWidth, 300)]; self.startDateView.backgroundColor = UIC 阅读全文

posted @ 2018-09-26 18:51 yucaijiang 阅读(1191) 评论(0) 推荐(0) 编辑

OC计算两个时间之间的时间差,结果单位为秒,需要除以60得到分钟数

摘要: //计算两个时间之间的时间差,结果单位为秒,需要除以60得到分钟数 NSDateFormatter* formater = [[NSDateFormatter alloc] init]; [formater setDateFormat:@"HH:mm:ss"];//根据自己的需求定义格式 NSDat 阅读全文

posted @ 2018-09-26 18:50 yucaijiang 阅读(748) 评论(0) 推荐(0) 编辑

OC删除全部NSUserDefaults储存的数据

摘要: //如果是退出登录,那么就删除本地存储的数据,遍历NSUserDefaults里面的所有key,将不是所需key的其他全部删掉 NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; NSDictionary* defaults = 阅读全文

posted @ 2018-09-26 18:48 yucaijiang 阅读(326) 评论(0) 推荐(0) 编辑

OC申请后台运行时间

摘要: //申请后台运行程序时间(当程序进去后台时,单位分钟) - (void)applicationDidEnterBackground:(UIApplication *)application { [[UIApplication sharedApplication]beginBackgroundTask 阅读全文

posted @ 2018-09-26 18:47 yucaijiang 阅读(363) 评论(0) 推荐(0) 编辑

导航