iOS网络编程(四):缓存类NSURLCache介绍 by andyron 2017-09-19 (上次更新: 2024-07-16) iOS 网络请求中缓存类NSURLCache常用属性和方法: //获取当前应用的缓存管理对象 + (NSURLCache *)sharedURLCache; //设置自定义的NSURLCache作为应用缓存管理 阅读全文
iOS网络编程(一):NSURLSession介绍 by andyron 2017-09-13 (上次更新: 2024-07-16) iOS NSURLSession是iOS7之后被用来代替NSURLConnection的网络开发框架,前者相对于后者的优势是支持后台处理能力 NSUR 阅读全文
使用Charles抓取iOS的http/https请求数据 by andyron 2017-09-12 (上次更新: 2024-07-16) iOS 工具 关于Charles不做多的介绍了,Charles官网一句话介绍简单明了: Web Debugging Proxy Application for Windows, Mac OS and Linux 一、安装Charles https://www.charlesproxy.com/download/ 二、安装Charles根 阅读全文
OC基础学习13:文件加载与保存 by andyron 2017-09-12 (上次更新: 2024-07-16) iOS Objective-C 1 属性列表(property list, plist) 属性列表可以保存的类型有NSArray,NSDictionary,NSString,NSNumber,NSD 阅读全文
OC基础学习12:代码块(Block) by andyron 2017-09-12 (上次更新: 2024-07-16) iOS Objective-C 代码块(Block)/闭包(closure) 是对C语言中函数的扩展。 代码块两种类的绑定: 自动绑定(automatic binding) 栈内存 托管绑定(man 阅读全文
OC基础学习11:协议 by andyron 2017-09-11 (上次更新: 2024-07-16) iOS Objective-C 1 正式协议 声明协议 1 2 3 @protocol NSCoding - (id) copyWithZone: (NSZone *) zone; @end 继承父协议: 1 2 @protocol MySuperDuberProtocol <MyParentProtocol> @end 采用协议 1 2 3 4 5 6 @interface Car :NSObject <NSCopying, NSCoding> { // instance variables } // methods @end // Car 实现协议 阅读全文
OC基础学习10:类别(category) by andyron 2017-09-11 (上次更新: 2024-07-16) iOS Objective-C 类别(category)是一种为现有的类添加新方法的方式。 1 创建类别 一般,只是习惯 把类别代码放在独立的文件中 命名:“类名称+类别 阅读全文
OC基础学习9:属性 by andyron 2017-09-11 (上次更新: 2024-07-16) iOS Objective-C 1 使用属性 接口代码简化 没有使用属性: 1 2 3 4 5 6 7 8 9 10 11 12 13 #import "Tire.h" @interface AllWeatherRadial : Tire { // 轮胎在潮湿和积雪的道路上的性能 float rainHandling; float snowHandling; } - (void) setRainHandling:(float)rainHandling; - (float) rainHandling; - (void) setSnowHandling:(float)snowHandling; - (float) 阅读全文
OC基础学习8:对象初始化 by andyron 2017-09-10 (上次更新: 2024-07-16) iOS Objective-C 1 分配(allocation)对象 alloc方法干的事件: 1 从操作系统获得一块内存。 2 指定为存储对象的实例变量的位置。 3 对内存初始化:BOO 阅读全文
iOS与JS(二):MessageHandler(OC&Swift) by andyron 2017-09-06 (上次更新: 2024-07-16) iOS iOS与JS的相互调用除了URL拦截(iOS与JS(一):使用URL拦截的方式进行JS与OC互相调用)外,还可以使用WKWebView的中的 阅读全文