上一页 1 2 3 4 5 6 7 ··· 15 下一页
摘要: iOS中使用了很多散列表: allocatedClasses = NXCreateHashTable(NXPtrPrototype, 0, nil); 阅读全文
posted @ 2019-12-16 12:12 do+better 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 头文件:#include <string.h>memmove() 用来复制内存内容,其原型为: void * memmove(void *dest, const void *src, size_t num);memmove() 与 memcpy() 类似都是用来复制 src 所指的内存内容前 num 阅读全文
posted @ 2019-12-16 11:32 do+better 阅读(672) 评论(0) 推荐(0) 编辑
摘要: 1. 分类和类定义相同的方法,会不会覆盖类方法: #import "FXPerson.h" @implementation FXPerson - (void)walk{ NSLog(@"person walk"); } @end #import "FXPerson+something.h" @imp 阅读全文
posted @ 2019-12-16 10:57 do+better 阅读(335) 评论(0) 推荐(0) 编辑
摘要: + (instancetype)yy_modelWithDictionary:(NSDictionary *)dictionary { if (!dictionary || dictionary == (id)kCFNull) return nil; if (![dictionary isKindO 阅读全文
posted @ 2019-12-15 16:26 do+better 阅读(464) 评论(0) 推荐(0) 编辑
摘要: KVC 为核心方法,闭源,没有源码,只能猜测。为了方便理解,自己根据官方文档的描述,实现了一个简单的KVC,所以是不安全的,只作为理解学习使用。(在导入第三方框架的时候,需要考虑是否有导入的必要性,权衡利弊) KVC官方文档 https://developer.apple.com/library/a 阅读全文
posted @ 2019-12-12 10:18 do+better 阅读(476) 评论(0) 推荐(0) 编辑
摘要: 枚举的基本用法 enum Direction { case north case south case east case west } enum Direction { case north, south, east, west } var dir = Direction.west dir = D 阅读全文
posted @ 2019-12-08 19:05 do+better 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 函数 func pi() -> Double{ return 3.14 } func sum(v1: Int, v2: Int) -> Int { return v1 + v2 } sum(v1: 10, v2: 20) 形参默认是let,也只能是let 无返回值 func sayHello() - 阅读全文
posted @ 2019-12-08 11:16 do+better 阅读(264) 评论(0) 推荐(0) 编辑
摘要: if-else let age = 4 if age >= 22 { print("Get married") } else if age >= 18 { print("Being a adult") } else if age >= 7 { print("Go to school") } else 阅读全文
posted @ 2019-12-07 13:18 do+better 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 常量 只能赋值一次 let age: Int age = 20 它的值不要求在编译时确定,但使用之前必须赋值一次 var num = 10 num += 20 num += 30 let age2 = num func getAge() -> Int{ return 10 } let age = g 阅读全文
posted @ 2019-12-07 09:03 do+better 阅读(227) 评论(0) 推荐(0) 编辑
摘要: ——瓦列里·毕加索夫于1988年4月26日自杀身亡 享年51岁,当天正是切尔诺贝利核泄漏时间两周年, 列加索夫的回忆录音带在苏联科学界流传开来,他的自杀让这些录音带无法被无视。 成为科学家就是成为天真的人. To be a scientist is to be native. 我们一心扑在寻找真相上 阅读全文
posted @ 2019-12-05 20:08 do+better 阅读(355) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 15 下一页