05 2017 档案
39、字符串去除空格
摘要:【问题分析】1、使用NSString中的stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]方法只是去掉左右两边的空格;2、使用NSString *strUrl = [urlString stringByRe
阅读全文
38、当前时间是否在开放时间内(也就是时间对比)
摘要:NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; // 设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制 // [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
阅读全文
37、自定义气泡
摘要:// 根据anntation生成对应的View - (BMKAnnotationView *)mapView:(BMKMapView *)mapView viewForAnnotation:(id <BMKAnnotation>)annotation {
阅读全文
36、NSTimer使用详解-开启、关闭、移除
摘要:1、要是用一个定时器,首先要定义一个定时器: @property(strong,nonatomic)NSTimer *myTimer;//定时器 2、初始化,初始化有两种方式: 第一种: + (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti ta
阅读全文
35、输入框(UITextField)密码明暗文切换
摘要:- (IBAction)pwdTextSwitch:(UIButton *)sender { // 前提:在xib中设置按钮的默认与选中状态的背景图 // 切换按钮的状态 sender.selected = !sender.selected; if (sender.selected) { // 按下
阅读全文
34、iOS App图标和启动画面尺寸
摘要:注意:iOS所有图标的圆角效果由系统生成,给到的图标本身不能是圆角的。 1. 桌面图标 (app icon) for iPhone6 plus(@3x) : 180 x 180 for iPhone 6/5s/5/4s/4(@2x) : 120 x 120 2. 系统搜索框图标 (Spotlight
阅读全文
33、iOS10 由于权限问题导致崩溃的大坑
摘要:控制台报忠告: This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an N
阅读全文
32、获取状态栏和导航栏高度、宽度信息
摘要:// 状态栏(statusbar) CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame]; NSLog(@"status width - %f", rectStatus.size.width); // 宽度 NS
阅读全文
31、iOS 正则表达式判断UITextField是否为全汉字,全字母,全数字,数字和字母
摘要:判断全汉字 if ([self deptNameInputShouldChinese]) { [DemonAlertHelper showToastWithMessage:@"只能是中文"]; return; } 调用这个方法就可 #pragma mark-- #pragma mark 输入中文 -
阅读全文
30、拨打电话方法
摘要:1.[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:186xxxx123"]]; 测试结果:不弹出提示框,直接跳转到通讯录拨打电话,通话结束返回到app。 2.UIWebView * callWebview
阅读全文
29、键盘消失的4种方法
摘要:处理UITextField,键盘消失问题 1. 通过UITextFiledDelegate,来释放第一响应者(resignFirstResponder);通过delegate释放键盘 -(BOOL)textFieldShouldReturn:(UITextFiled*)textField{ [tex
阅读全文