摘要: 转载自:http://www.cnblogs.com/kimimaro/archive/2011/11/29/2267920.html,尊重原创!NSAutoReleasePool * pool = [NSAutoReleasePool alloc] init];//do something之后,[pool drain] 和 [pool release] 的区别:release,在引用计数环境下,由于NSAutoReleasePool是一个不可以被retain的类型,所以release会直接dealloc pool对象。当pool被dealloc的时候,pool向所有在pool中的对象发出一个 阅读全文
posted @ 2013-06-25 21:26 little_star 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://www.cnblogs.com/jay-dong/archive/2013/01/21/2870414.html,尊重原创!1、常见的NSFileManager文件方法-(NSData *)contentsAtPath:path //从一个文件读取数据-(BOOL)createFileAtPath: path contents:(NSData *)data attributes:attr //向一个文件写入数据-(BOOL)removeItemAtPath:path error:err //删除一个文件-(BOOL)moveItemAtPath:from toPat... 阅读全文
posted @ 2013-06-25 17:15 little_star 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://blog.sina.com.cn/s/blog_8c87ba3b0100tgfs.html,尊重原创如果你能够真正的理解autorelease,那么你才是理解了Objective c的内存管理。Autorelease实际上只是把对release的调用延迟了,对于每一个Autorelease,系统只是把该Object放入了当前的Autorelease pool中,当该pool被释放时,该pool中的所有Object会被调用Release。[1]在Iphone项目中,大家会看到一个默认的Autorelease pool,程序开始时创建,程序退出时销毁,按照对Autorelea 阅读全文
posted @ 2013-06-25 14:33 little_star 阅读(253) 评论(0) 推荐(0) 编辑
摘要: DirectiveMeaning@privateThe instance variable is accessible only within the class that declares it.@protected实例变量只能被声明它的类访问The instance variable is accessible within the class that declares it and within classes that inherit it. All instance variables without an explicit scope directive have@protect 阅读全文
posted @ 2013-06-25 14:23 little_star 阅读(334) 评论(0) 推荐(0) 编辑