I am compiling code to avoid Retain Cycle, When I use weak
, I got this error: 1. property of weak attribute must be of object type
; 2. Unknown type name 'OrderEntry'
. What is wrong with the code? Thanks!
// OrderEntry.h
#import <Foundation/Foundation.h>
#import "OrderItem.h"
#import "Address.h"
@interface OrderEntry : NSObject
@property (strong, nonatomic)OrderItem *orderItem;
@property (strong, nonatomic)Address *shippingAddress;
@property (strong, nonatomic) NSString *orderID;
@end
// OrderItem.h
#import <Foundation/Foundation.h>
#import "OrderEntry.h"
@interface OrderItem : NSObject
@property (strong,nonatomic) NSString *name;
@property (weak, nonatomic) OrderEntry *entry;
@end