随笔分类 -  iOS开发

没有dsym分析iOS崩溃日志
摘要:1.找到crash log信息:xcode->windows->Devices and Simulators->View Device logs->This Device 1.找到crash log信息:xcode->windows->Devices and Simulators->View Dev 阅读全文

posted @ 2020-05-31 17:05 sunyaxue 阅读(1647) 评论(0) 推荐(0)

pod install时CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/
摘要:解决方法: 1.不替换cdn源: 步骤:1.终端执行sudo vim /private/etc/hosts 2.在hosts文件中添加199.232.4.133 raw.githubusercontent.com的映射,重新执行pod install 2.用source 'https://githu 阅读全文

posted @ 2020-05-15 16:42 sunyaxue 阅读(2604) 评论(0) 推荐(0)

fastlane环境配置
摘要:# fastlane 环境配置 ## 1. 安装xcode命令行工具 xcode-select --install,如果没有安装,会弹出对话框,点击安装。如果提示xcode-select: error: command line tools are already installed, use "Software Update" to install updates表示已经安装 ## 2.安... 阅读全文

posted @ 2019-01-30 10:14 sunyaxue 阅读(515) 评论(0) 推荐(0)

iOS 安全区域适配
摘要:CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame]; CGFloat rectStatusHeight = rectStatus.size.height; NSLog(@"status width - %f", rectStatus.size.width); // 宽度 NS... 阅读全文

posted @ 2019-01-28 11:03 sunyaxue 阅读(385) 评论(0) 推荐(0)

iOS学习——获取当前最顶层的ViewController
摘要:转载自:https://www.cnblogs.com/mukekeheart/p/8399125.html 在iOS开发过程中,我们经常性会需要获取当前页面的ViewController,然后利用ViewController进行一些操作,例如在最顶层的ViewController上展示一个UIAl 阅读全文

posted @ 2019-01-24 14:33 sunyaxue 阅读(425) 评论(0) 推荐(0)

block的那些事
摘要:block分为__NSGlobalBlock__,__NSStackBlock__,__NSMallocBlock__。 在MRC中 打印结果 在ARC中执行同样的代码打印结果是 由此可见在ARC中没有栈区block,只有堆区和全局区。 在MRC中,有栈区,并且strong相当于copy,会把blo 阅读全文

posted @ 2019-01-16 19:02 sunyaxue 阅读(183) 评论(0) 推荐(0)

iOS底层结构
摘要:一、Class 二、Object 三、Method IMP SEL 四、Ivar 五、objc_property_t 测试 获取ivarList 获取propertyList 获取对象方法列表 获取类方法列表 另一种获取类方法列表的方法 附上一张isa指针图(虚线isa指针,实线superclass 阅读全文

posted @ 2019-01-16 19:02 sunyaxue 阅读(236) 评论(0) 推荐(0)

iOS方法调用的几种方式
摘要:iOS调用一个方法基本上有四种方式:1)直接对类调用类方法,对象调用对象方法。2)使用performSelector的方式调用。3)使用NSInvocation调用方法。4)使用runtime,ojbc_msgSend调用。 1)直接调用 2)使用performSelector的方式调用, perf 阅读全文

posted @ 2019-01-16 19:01 sunyaxue 阅读(1467) 评论(0) 推荐(0)

iOS webView 设置cookie
摘要:在 - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType中添加代码 阅读全文

posted @ 2017-06-22 17:43 sunyaxue 阅读(730) 评论(0) 推荐(0)

swift 图像的压缩上传
摘要:func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) { picker.dismissViewControllerAnimated(true, completion: nil) ... 阅读全文

posted @ 2016-06-13 16:17 sunyaxue 阅读(2242) 评论(0) 推荐(0)

swift UILabel加载html源码
摘要:@IBOutlet weak var content: UILabel! func setup(content:String){ self.content.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.size.width - 36 let content = "" + cont... 阅读全文

posted @ 2016-06-13 16:04 sunyaxue 阅读(3060) 评论(0) 推荐(0)

UITableViewCell上面添加UIWebView
摘要:首先创建一个webView对象和 在viewDidLoad里面设置创建webViewcell,设置属性并用kvo监听webViewcell中scrollView的size的变化 在tableview的数据源中把webViewCell添加到cell上面 把监听到的高纪录一下,设置webviewcell 阅读全文

posted @ 2016-06-13 15:58 sunyaxue 阅读(709) 评论(0) 推荐(0)

iOS 富文本点击事件
摘要:1 #import "ViewController.h" 2 3 #define font 17 4 @interface ViewController ()<UITextViewDelegate> 5 @property (weak, nonatomic) IBOutlet UITextView 阅读全文

posted @ 2016-06-13 15:32 sunyaxue 阅读(19224) 评论(4) 推荐(0)

iOS 导航栏 不透明
摘要:UINavigationBar.appearance().translucent = false UINavigationBar.appearance().barStyle = UIBarStyle.Default ps: Ios7禁止全局设置导航栏的透明状态 阅读全文

posted @ 2015-12-03 11:55 sunyaxue 阅读(493) 评论(0) 推荐(0)

swift 函数
摘要:函数:1.定义函数的语法格式:func 函数名(形参列表) -> 返回值类型{ // 可执行语句组成的函数}2.函数的形参(函数定义时) (1)没有参数的函数,小括号必须要有 (2)外部参数名 局部参数名:形参类型 (3)外部参数和局部参数一样的话,只需在局部参数前面加# (4)可变参数:在参数类... 阅读全文

posted @ 2015-12-03 11:52 sunyaxue 阅读(180) 评论(0) 推荐(0)

swift 手势之UIPanGestureRecognizer
摘要: 阅读全文

posted @ 2015-12-03 11:47 sunyaxue 阅读(2320) 评论(0) 推荐(0)

swift UILable的用法
摘要: 阅读全文

posted @ 2015-11-04 15:07 sunyaxue 阅读(151) 评论(0) 推荐(0)

mac 文件路径问题
摘要:Finder栏显示访问路径操作步骤: 打开“终端”(应用程序-》实用工具),输入以下两条命令: defaults write com.apple.finder _FXShowPosixPathInTitle -bool TRUE; killall Finder 你看完整的路径地址出来了吧。... 阅读全文

posted @ 2015-11-04 14:05 sunyaxue 阅读(225) 评论(0) 推荐(0)

XCode工程内多Targets
摘要:XCode工程内多Targets 可以认为一个target对应一个新的product(基于同一份代码的情况下). 虽然代码是同一份, 但编译设置(比如编译条件), 以及包含的资源文件却可以有很大的差别. 于是即使同一份代码, 产出的product也可能大不相同. 1.复制一个targets 2.修改 阅读全文

posted @ 2015-09-24 16:21 sunyaxue 阅读(195) 评论(0) 推荐(0)

iOS 打电话、发短信、发邮件功能
摘要:打电话 方法1 最简单最直接的方式:直接跳到拨号界面 NSURL *url = [NSURL URLWithString:@"tel://10010"]; [[UIApplication sharedApplication] openURL:url]; 缺点:电话打完后,不会自动回到原应用,直接停留 阅读全文

posted @ 2015-09-22 15:21 sunyaxue 阅读(180) 评论(0) 推荐(0)

导航