1,什么是循环retain?
两个类之间互相包含;
例如:Dog中retain了一个Person,Person中retain了一个Dog;
@interface Dog : NSObject
@property (nonatomic,retain) Person *owner;
@end
@interface Person : NSObject
@property (nonatomic,retain) Dog *dog;
@end
Person *p = [Person new];
Dog *d = [Dog new];
p.dog = d;
d.owner = p;
|
|