HardBirch

Object-C Weak&Strong

时间:12-08-23 栏目:iOS移动应用开发技术 作者:张飞不张,文采横飞 评论:0 点击: 1,556 次

  • strongkeep this in the heap until I don’t point to it anymore
    I won’t point to it anymore if I set my pointer to it to nil.Or if I myself am removed from the heap because no one strongly points to me!
  • weak
    keep this as long as someone else points to it strongly” If it gets thrown out of the heap, set my pointer to it to nil automatically (if user
    on iOS 5 only).
  • This is not garbage collection!
     It’s way better. It’s reference counting done automatically for you.
  • Finding out that you are about to leave the heap A special method, dealloc, is called on you when your instance’s memory is freed from the heap. You will rarely ever have to implement
    this method. It’s “too late” to do much useful here.

声明: 本文由( 张飞不张,文采横飞 )原创编译,转载请保留链接: Object-C Weak&Strong

Object-C Weak&Strong:等您坐沙发呢!

发表评论


QQ群互动

Linux系统与内核学习群:194051772

WP建站技术学习交流群:194062106

魔豆之路QR

魔豆的Linux内核之路

魔豆的Linux内核之路

优秀工程师当看优秀书籍

优秀程序员,要看优秀书!

赞助商广告

友荐云推荐