上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页
摘要: ARC的判断准则:只要没有强指针指向对象,就会释放对象 指针分2种 1强指针:默认情况下,所有的指针都是强指针 __strong 2弱指针:__weak __weak Person* p=[Person new]错误写法 用弱指针对象会被释放 属于 编译特性 strong :强指针相当于原来reta 阅读全文
posted @ 2016-04-23 23:12 谢小锋 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 一方面解决循环引用问题 一方面解决性能问题 2循环应用 、 阅读全文
posted @ 2016-04-22 22:20 谢小锋 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 在Xcode6之前,创建一个新工程xcode会在Supporting files文件夹下面自动创建一个“工程名-Prefix.pch”文件,也是一个头文件,pch头文件的内容能被项目中的其他所有源文件共享和访问。是一个预编译文件。 首先说一下pch的作用: 1.存放一些全局的宏(整个项目中都用得上的 阅读全文
posted @ 2016-04-18 16:15 谢小锋 阅读(7238) 评论(0) 推荐(0) 编辑
摘要: 1.runtime是一套底层的C语言API (很多包含强大的实用的C语言数据类型。C语言函数) 2.实际上,平时编写的OC代码,底层都是基于runtime实现的 也就是说,最终是转成底层runtime代码 unsigned int count=0; Ivar * ivars= class_copyI 阅读全文
posted @ 2016-04-18 16:13 谢小锋 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-04-15 11:43 谢小锋 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 访问坏的内存,被回收已经不可以用的内存,野指针 OC 中不存在空指针错误,发送消息,不报错 阅读全文
posted @ 2016-04-09 23:12 谢小锋 阅读(120) 评论(0) 推荐(0) 编辑
摘要: //// ViewController.m// touchID//// Created by 谢泽锋 on 16/4/1.// Copyright © 2016年 xiezefeng. All rights reserved.//#import "ViewController.h"#import < 阅读全文
posted @ 2016-04-01 11:16 谢小锋 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 对象属性 (实例变量\成员变量 默认初始化为0) @interface car :NSObject @public //只要公共才可以被外界访问 Car->age=23; int name; (实例变量,成员变量) int age; @end @implementation car//方法的实现 - 阅读全文
posted @ 2016-03-15 14:35 谢小锋 阅读(108) 评论(0) 推荐(0) 编辑
摘要: struct student { int age; char *name; }; struct student one ={23,"zefeng"}; struct student two = {55,"fengzi"}; two.age=99; struct student all[2]={one 阅读全文
posted @ 2016-03-10 16:41 谢小锋 阅读(143) 评论(0) 推荐(0) 编辑
摘要: a的b次方 int pow(int a,int b){ if(b<0)return 1; return pow(a,b-1)*a;} 阅读全文
posted @ 2016-03-10 14:35 谢小锋 阅读(95) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页