// Dog.h 文件 @class Person; @interface Dog : NSObject @property (nonatomic,retain) Person *owner; @end
// Person.h 文件 @class Dog; @interface Person : NSObject //人拥有一条狗 @property (nonatomic,retain) Dog *dog; @end
解决方案: @property (nonatomic,assign) Person *owner; @property (nonatomic,retain) Dog *dog;
或者: @property (nonatomic,retain) Person *owner; @property (nonatomic,assign) Dog *dog;
|