随笔分类 - iOS萃取精华
不轻视每个细节,随时记录每个新的知识,抱着认真、负责的态度,成功距离你就会越来越近。
53.设置内容的行间距
摘要://设置介绍内容行间距 -(void)LineSpacing:(UILabel*)lab{ NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:lab.te
阅读全文
52.tableViewCell重用机制避免重复显示问题
摘要:表刷新超出页面显示的内容会重复出现 -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //定义唯一标识 static NSString *cell
阅读全文
50.IOS上传APP问题
摘要:更新版本的时候遇到几个问题 1.ERROR ITMS-90535: "Unexpected CFBundleExecutable Key. The bundle at 'Payload/dianlan2.app/EaseUIResource.bundle' does not contain a bu
阅读全文
48.UIButton上的字体居右对齐
摘要:UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; button.titleLabel.textAlignment = NSTextAlignmentLeft;这行代码是没有效果的,只是标签中的文本右对齐,没有改变标签在按钮中的
阅读全文
47.iOS跳转AppStore评分和发送邮件
摘要:1.跳转到AppStore评分 应用地址是关键:IOS 设备,手机搜索应用,拷贝链接 NSString *appStr =@"https://itunes.apple.com/cn/app/%E9%91%AB%E5%AE%A2%E9%80%9A/id1227457584?mt=8""; [[UIAp
阅读全文
46.UISearchBar的placeholder字体颜色和背景颜色
摘要:1.改变searchbar的searchField属性 UITextField *searchField = [searchbar valueForKey:@"searchField"]; if (searchField) { // 背景色 [searchField setBackgroundCol
阅读全文
45.UITableView去除分割线
摘要:1.去除所有的分割线 table.separatorStyle = UITableViewCellSelectionStyleNone; 2.去除指定某一行的分割线 cell.separatorInset = UIEdgeInsetsMake(0, width_w, 0, 0);
阅读全文
51.从首页内容跳转到第二个Tabbar控制器(controller)
摘要:TabBarController: 创建TabBar的控制器 注意:在点击的内容方法页面,添加头文件 #import "TabBarController.h" #import "AppDelegate.h" AppDelegate *delegate = (AppDelegate *)[[UIApp
阅读全文
43.Charles抓包(iOS的http/https请求)
摘要:Charles安装 HTTP抓包 HTTPS抓包 1. Charles安装 官网下载安装Charles: https://www.charlesproxy.com/download/ 2. HTTP抓包 (1)查看电脑IP地址 (2)设置手机HTTP代理 手机连上电脑,点击“设置->无线局域网->连
阅读全文
42.OC中instancetype与id的区别
摘要:区别: 在ARC(Auto Reference Count)环境下: instancetype用来在编译期确定实例的类型,而使用id的话,编译器不检查类型,运行时检查类型 在MRC(Manual Reference Count)环境下: instancetype和id一样,不做具体类型检查 区别2:
阅读全文
41.App 框架的搭建思路以及代码的规范
摘要:本链接 引用别人文章https://www.jianshu.com/p/d553096914ff
阅读全文
44、WebStrom下载和破解
摘要:WebStrom下载地址: http://www.pc6.com/mac/112553.html WebStrom 2017激活破解(http://blog.csdn.net/it_talk/article/details/52448597) • 2017-06-15更新 • 之前都是使用2017.
阅读全文
40、IOS自动打包-Python脚本
摘要:第一种:基于编译的打包 编译工程--找到.app文件--新建Payload文件夹--拷贝.app到Payload文件夹--压缩成zip--更改后缀名为ipa--完成! 第二种(有问题,暂时不需要看) 第一步:打开终端,cd 到脚本所在目录 $ cd /Users/chenxiaonan/Downlo
阅读全文
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
阅读全文