Why are Objective-C delegates usually given the property assign instead of retain?
来源:互联网 发布:永久禁止程序访问网络 编辑:程序博客网 时间:2024/05/01 10:22
A creates B A sets itself as B's delegate … A is released by its owner
If B had retained A, A wouldn't be released, as B owns A, thus A's dealloc would never get called, causing both A and B to leak.
You shouldn't worry about A going away b/c it owns B and thus gets rid of it in dealloc.
- Why are Objective-C delegates usually given the property assign instead of retain?
- Why are Objective-C delegates usually given the property assign instead of retain?
- Objective-C 2.0属性(Property) retain,copy,assign,copy
- Objective-C的@property 详解(ios,iphone,xcode,retain,release,assign,copy)
- Objective-C的@property 详解(ios,iphone,xcode,retain,release,assign,copy)
- Objective-C的@property 详解(ios,iphone,xcode,retain,release,assign,copy)
- Objective-C的@property 详解(ios,iphone,xcode,retain,release,assign,copy)
- Objective-C中的@property和@synthesize用法及参数(readwrite/readonly)(assign/retain/copy)(atomicity/nonatomic)
- Objective-c 的 内存管理和@property strong,weak,assign,copy,retain等关键字介绍
- Objective-c 的 @property strong,weak,assign,copy,retain等关键字介绍
- object-c:property,assign,copy,retain,release
- objective-c 中retain,assign,copy
- objective-c -- nonatomic,assign,copy,retain 理解
- Objective-C - retain release autorelease assign copy
- [Objective-C] assign/retain/copy 详解
- Objective-C assign、retain、copy区别
- the difference of retain and assign
- object-c:property,assign,copy,retain,release区别
- AlarmManager2
- 3D技术:提供真实可触的虚拟境界,激起新一轮的网络经济变革
- 数米粒个数和每个米粒面积的matlab算法实现(递归)。
- 互联网产品交互设计体验的前世今生
- 互联网开放与垄断的辩证关系
- Why are Objective-C delegates usually given the property assign instead of retain?
- 新浪“微币”加入“货币战争” 虚拟货币谁贬值
- 嵌入式系统概括
- kthread_create和kernel_thread的区别和总结
- c语言五大排序算法
- arm-linux-gcc-3.4.1交叉编译器在redhat9.0下的安装(VMware)
- 语言之父Dennis Ritchie辞世
- linux 内核模块编程简要总结
- html table tr td br 什么意思 缩写