随笔分类 -  oc

摘要:https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html About Objective-C 阅读全文
posted @ 2017-07-24 23:40 zzfx 阅读(135) 评论(0) 推荐(0) 编辑
摘要:Objective-C语言是一门动态语言,它将很多静态语言在编译和链接时期做的事放到了运行时来处理。这种动态语言的优势在于:我们写代码时更具灵活性,如我们可以把消息转发给我们想要的对象,或者随意交换一个方法的实现等。 这种特性意味着Objective-C不仅需要一个编译器,还需要一个运行时系统来执行 阅读全文
posted @ 2017-07-24 19:31 zzfx 阅读(175) 评论(0) 推荐(0) 编辑
摘要:http://blog.csdn.net/tskyfree/article/details/7984887 一、Objective-C多态 1.概念:相同接口,不同的实现 来自不同类可以定义共享相同名称的方法。 动态类型能使程序直到执行时才确定对象所属类型 动态类型绑定能使程序直到执行时才确定要对对 阅读全文
posted @ 2017-07-24 19:27 zzfx 阅读(245) 评论(0) 推荐(0) 编辑
摘要:https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/DefiningClasses/DefiningClasses.html#//apple_ref/ 阅读全文
posted @ 2017-07-24 19:19 zzfx 阅读(133) 评论(0) 推荐(0) 编辑
摘要:http://www.jianshu.com/p/b7169a5a558e OS 分类底层是怎么实现的?本文将分如下四个模块进行探究 本文使用的runtime源码版本是 objc4 - 680文中类与分类代码如下 1.分类的结构体 2.编译时的分类 2.1分类的属性 对比上述代码可以发现:在分类中可 阅读全文
posted @ 2017-07-07 19:13 zzfx 阅读(912) 评论(0) 推荐(0) 编辑
摘要:https://tech.meituan.com/DiveIntoCategory.html 摘要 无论一个类设计的多么完美,在未来的需求演进中,都有可能会碰到一些无法预测的情况。那怎么扩展已有的类呢?一般而言,继承和组合是不错的选择。但是在Objective-C 2.0中,又提供了category 阅读全文
posted @ 2017-07-07 19:11 zzfx 阅读(561) 评论(0) 推荐(0) 编辑
摘要:http://www.cnblogs.com/yashi88/p/3551947.html 最近在做一个项目的时候,需要使用到一个第三方库,这个库的使用向导里面特别说明,在添加完该库后,需要在Xcode的Build Settings下Other Linker Flags里面加入-ObjC标志,这个标 阅读全文
posted @ 2017-07-07 18:39 zzfx 阅读(232) 评论(0) 推荐(0) 编辑
摘要:The only way to circumvent dynamic binding is to get the address of a method and call it directly as if it were a function. This might be appropriate 阅读全文
posted @ 2017-07-07 11:51 zzfx 阅读(151) 评论(0) 推荐(0) 编辑
摘要:字面量: 字符串:单引号或双引号扩起来; %@:系统自动添加,数字则自动去除@(); 无单双引号,系统做数字处理。 Single or double quoting variables (or substitution variable strings) cause %@, %K, or $vari 阅读全文
posted @ 2017-06-28 18:35 zzfx 阅读(451) 评论(0) 推荐(0) 编辑
摘要:https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/KeyValueCoding/DataTypes.html The default implementation of the key-value c 阅读全文
posted @ 2017-06-20 17:09 zzfx 阅读(164) 评论(0) 推荐(0) 编辑
摘要:https://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library The answer from Vladimir is actually pretty good, however, I'd li 阅读全文
posted @ 2017-06-19 19:02 zzfx 阅读(183) 评论(0) 推荐(0) 编辑
摘要:https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtHowMessagingWorks.html#//apple_ref/doc/uid/TP 阅读全文
posted @ 2017-06-19 16:34 zzfx 阅读(174) 评论(0) 推荐(0) 编辑
摘要:? https://opensource.apple.com/source/objc4/objc4-493.9/runtime/ 阅读全文
posted @ 2017-06-15 19:17 zzfx 阅读(491) 评论(0) 推荐(0) 编辑
摘要:struct objc_method { SEL _Nonnull method_name OBJC2_UNAVAILABLE; char * _Nullable method_types OBJC2_UNAVAILABLE; IMP _Nonnull method_imp OBJC2_UNAVAI 阅读全文
posted @ 2017-06-15 18:51 zzfx 阅读(536) 评论(0) 推荐(0) 编辑
摘要:http://blog.csdn.net/csz0102/article/details/25984275 注:以下讨论都是在ARC模式下 我们在iOS开发中最经常碰到的“引用(reference)”的使用是在error上,比如如下代码 [objc] view plain copy NSError  阅读全文
posted @ 2017-03-03 18:28 zzfx 阅读(501) 评论(0) 推荐(0) 编辑
摘要:typedef struct structTest { char xchar; int xint; int yint; }xStruct; @interface ViewController () { char xchar; int xint; int yint; } xStruct xTest = 阅读全文
posted @ 2017-02-22 14:40 zzfx 阅读(232) 评论(0) 推荐(0) 编辑
摘要:http://www.jianshu.com/p/0042d8eb67c0 最近整理了一下原生与H5之间的交互方式,简单的做个总结。OC端与JS的交互,大致有这几种:拦截协议、JavaScriptCore库、WKWebView、自定义NSURLProtocol拦截、WebViewJavascript 阅读全文
posted @ 2016-12-01 00:29 zzfx 阅读(2077) 评论(0) 推荐(0) 编辑
摘要:http://www.jianshu.com/p/1328e15416f3/comments/1724404 javascript目前看来仍是世界上最流行的语言,不管在web、服务端还是客户端都有广泛的应用,很多跨平台方案也采用js来实现,比如著名的reactjs,苹果在iOS7引入了javascr 阅读全文
posted @ 2016-11-26 00:29 zzfx 阅读(1567) 评论(0) 推荐(0) 编辑
摘要:http://chun.tips/blog/2014/11/05/bao-gen-wen-di-objective%5Bnil%5Dc-runtime-(2)%5Bnil%5D-object-and-class-and-meta-class/ 刨根问底Objective-C Runtime(1)- 阅读全文
posted @ 2016-11-07 23:38 zzfx 阅读(232) 评论(0) 推荐(0) 编辑
摘要:版权声明:转载请注明出处:http://blog.csdn.net/hursing 版权声明:转载请注明出处:http://blog.csdn.net/hursing 方法一,hook已有公开头文件的类: 首先写一个Utility函数: #import <objc/runtime.h> void e 阅读全文
posted @ 2016-10-31 15:12 zzfx 阅读(1372) 评论(0) 推荐(0) 编辑