iOS.-.cxx_destruct

-.cxx_destruct 方法: 该方法是由编译器生成的方法。

1. “ARC actually creates a -.cxx_destruct method to handle freeing instance variables. This method was originally created for calling C++ destructors automatically when an object was destroyed. The visible difference of this with ARC is that Objective-C instance variables are now deallocated after -dealloc in the root class has finished, not before. In most cases, this should make no difference.” R[1]

 

2. R[2] 链接中的内容充分说明了: "-.cxx_destruct" 是在其父类(这里可能有出入)的dealloc被调用后才被调用的。

 

Reference:

1.  Objective-C Phrase Book, Second Edition

http://my.safaribooksonline.com/book/programming/objective-c/9780132908641/3dot-memory-management/ch03

2. Effective Objective-C 2.0: 52 Specific Ways to Improve Your iOS and OS X 

Item 30: Use ARC to Make Reference Counting 

http://books.google.com.hk/books?id=qp4ZXAmGaoQC&pg=PT185&lpg=PT185&dq=iOS+.cxx_destruct+crash&source=bl&ots=tYmMdkMg2t&sig=Jk4L0lHPTy8nPVfIEPUmkR7zNrE&hl=en&sa=X&ei=ZTJuUt3TA8SOkwXXvYDACQ&ved=0CGgQ6AEwCQ#v=onepage&q=.cxx_destruct&f=false

3. http://sweettolife.com/questions/12562058/arc-converted-app-crashing-with-last-call-to-cxx-destruct

转载于:https://www.cnblogs.com/cwgk/p/3419797.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值