摘要: runtime机制为我们提供了一系列的方法让我们可以在程序运行时动态修改类、对象中的所有属性、方法。下面就介绍运行时一种很常见的使用方式,字典转模型。当然,你可能会说,“我用KVO直接 setValuesForKeysWithDictionary: 传入一个字典一样可以快速将字典转模型啊”,但是这种... 阅读全文
posted @ 2014-12-19 23:51 ablett 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 关于“runtime机制”的问题,要深入理解runtime,首先要从最基本的类与对象开始,本文将详细讲解OC中类与对象的结构层次,后续将逐渐更新如何利用runtime操作类。首先,我们从/usr/include/objc/objc.h 和 runtime.h 中找到对 class 与 object ... 阅读全文
posted @ 2014-12-19 23:49 ablett 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 首先,NSAssert 是foundation.framework 框架中的一个宏定义,作为断点检查的条件信息。如果给他一个 false 条件,会生成一个断点检查。NSAssertGenerates an assertion if a given condition is false.Declara... 阅读全文
posted @ 2014-11-17 09:48 ablett 阅读(240) 评论(0) 推荐(0) 编辑
摘要: main.mint main(int argc, const char * argv[]){ @autoreleasepool { /* 在ios直接调用某个对象的消息是方法有两种: 一:performselector:withOb... 阅读全文
posted @ 2014-09-12 14:39 ablett 阅读(173) 评论(1) 推荐(0) 编辑
摘要: In the new XCode 5.1, arm64 has become among the standard architectures to build for.However, in current projects of mine I included libraries (Google AdMob for example) that do not yet support this new architecture - these are now causing linker errors:ld: symbol(s) not found for architecture arm64 阅读全文
posted @ 2014-03-20 17:29 ablett 阅读(409) 评论(0) 推荐(0) 编辑