想当时iOS SDK 2.1开始编写iOS程序,一开始就需要考虑什么时间,什么地点Release,稍有不慎就会导致Crash,Zombies.

费了老大功夫终于搞定什么时候Release,当时小得意一下.

Release就是代表了你iOS的功力有多深!!!

 

iOS5 ARC这个东东,我尝试了一下

作为测试,写了一个很简单的代码

- (IBAction)ArcTestClick:(id)sender {
    
    for (int i=0; i<1000; i++) {
        
        UIWebView * w=[[UIWebView alloc] init];
        w.backgroundColor=[UIColor blueColor];
    }
    
    

}

然后分别用Instruments的Allocations测试效果

No ARC

图如下:

 别了 Release

 

 新建一个项目勾选了 Automatic Reference Counting.

 

别了 Release 

别了release. 

 

相关文章:

  • 2022-01-21
  • 2021-12-05
  • 2021-10-25
  • 2021-09-16
  • 2021-12-20
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-01
  • 2022-02-18
  • 2022-03-07
  • 2021-08-14
  • 2021-10-14
  • 2021-07-15
相关资源
相似解决方案