1 //归档:将对象数据存储到文件的过程 NSArchiver 2 //反归档:从文件中读取数据到对象中的过程 3 4 int main(int argc, const char * argv[]) { 5 @autoreleasepool { 6 7 ...
分类:
其他好文 时间:
2015-06-24 10:51:54
阅读次数:
117
代码结构 函数名 参照了cocos2dx风格 pool.h
#include?<iostream>
#include"stack"
#include?"vector"
using?namespace?std;
class?MangerPool;
class?autoreleasePool;
class?Ref
{
private:
unsig...
分类:
其他好文 时间:
2015-06-23 21:50:26
阅读次数:
125
retainCount//dealloc方法,是对象的临终遗言的方法//对象被销毁的时候,会默认的调用该方法//注意:dealloc 方法是系统根据引用计数器的值,自动调用的,野指针内存泄露@property参数@class 使用循环retain解决方法自动释放池@autoreleasepool
分类:
移动开发 时间:
2015-06-23 14:58:56
阅读次数:
178
main.m 1 #import 2 #import "TestClass.h" 3 4 int main(int argc, const char * argv[]) { 5 @autoreleasepool { 6 NSString *purposeInfo = @"...
分类:
其他好文 时间:
2015-06-20 11:53:04
阅读次数:
109
autorelease pool 使用注意事项:
在 ARC 下,不能使用 [ [ NSAutoreleasePool alloc ] init ] ,而应当使用 @autoreleasepool ;
不要把大量循环操作放到同一个 NSAutoreleasePool 之间,这样会造成内存峰值的上升 ;
尽量避免对大内存使用该方法,对于这种延迟释放机制,还是尽量少用 ;
sdk 中一般利用静态方法创建...
分类:
其他好文 时间:
2015-06-20 10:34:14
阅读次数:
155
typedef struct Person{ int age; char *name;}Person;int main(int argc, const char * argv[]) { @autoreleasepool { Person person; person.name ="...
分类:
其他好文 时间:
2015-06-19 20:16:52
阅读次数:
80
main.m 1 #import 2 #import "NSString+Trim.h" 3 int main(int argc, const char * argv[]) { 4 @autoreleasepool { 5 NSString *strSource = @" ...
分类:
其他好文 时间:
2015-06-13 21:39:55
阅读次数:
2085
程序的启动过程:main函数中执行了一个UIApplicationMain这个函数int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFrom...
分类:
移动开发 时间:
2015-06-13 06:18:28
阅读次数:
180
文件操作 #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { ??? @autoreleasepool { ??????? // insert code here... ??????? NSLog(@"Hello, World!"); ????...
分类:
其他好文 时间:
2015-06-12 01:13:58
阅读次数:
208
autoreleasepool 池子被销毁的时候被标记 autorelease 的对象调用一次releasePerson *p2=[[[Person alloc]init]autorelease];标记为autoreleaseassign默认参数,setter方法不会引起引用计数的变化retain ...
分类:
其他好文 时间:
2015-06-08 21:24:43
阅读次数:
83