正确使用 autorelease pool blocks

来源:互联网 发布:胡凤珠c语言全套课件 编辑:程序博客网 时间:2024/05/21 21:39

1. 不基于 一个 UI框架 例如 a command-line tool。

2. 循环创建许多临时对象。使用 autorelease pool blocks 减少应用程序最大内存占用。

3.生成一个辅助线程。 

  • You must create your own autorelease pool block as soon as the thread begins executing; otherwise, your application will leak objects. (See Autorelease Pool Blocks and Threads for details.)

自动释放池 资料链接

0 0
原创粉丝点击