if (!Setter)
append_attr(PropertyString, "readonly");
- // Short circuit properties that contain the name "delegate" or "dataSource",
- // or have exact name "target" to have unsafe_unretained attribute.
+ // Short circuit 'delegate' properties that contain the name "delegate" or
+ // "dataSource", or have exact name "target" to have 'assign' attribute.
if (PropertyName.equals("target") ||
(PropertyName.find("delegate") != StringRef::npos) ||
(PropertyName.find("dataSource") != StringRef::npos))
- append_attr(PropertyString, "unsafe_unretained");
+ append_attr(PropertyString, "assign");
else if (Setter) {
const ParmVarDecl *argDecl = *Setter->param_begin();
QualType ArgType = Context.getCanonicalType(argDecl->getType());
@interface Action
@property (nonatomic) SEL action;
-@property (nonatomic, unsafe_unretained) id target;
+@property (nonatomic, assign) id target;
@end
// Properties that contain the name "delegate" or "dataSource",
// or have exact name "target" have unsafe_unretained attribute.
@interface NSInvocation
-@property (atomic, unsafe_unretained) id target;
+@property (atomic, assign) id target;
-@property (atomic, unsafe_unretained) id dataSource;
+@property (atomic, assign) id dataSource;
-@property (atomic, unsafe_unretained) id xxxdelegateYYY;
+@property (atomic, assign) id xxxdelegateYYY;
@interface NSInvocation(CAT)
-@property (atomic, unsafe_unretained) id target;
+@property (atomic, assign) id target;
-@property (atomic, unsafe_unretained) id dataSource;
+@property (atomic, assign) id dataSource;
-@property (atomic, unsafe_unretained) id xxxdelegateYYY;
+@property (atomic, assign) id xxxdelegateYYY;
// Properties that contain the name "delegate" or "dataSource",
// or have exact name "target" have unsafe_unretained attribute.
@interface NSInvocation
-@property (nonatomic, unsafe_unretained) id target;
+@property (nonatomic, assign) id target;
-@property (nonatomic, unsafe_unretained) id dataSource;
+@property (nonatomic, assign) id dataSource;
-@property (nonatomic, unsafe_unretained) id xxxdelegateYYY;
+@property (nonatomic, assign) id xxxdelegateYYY;
@interface NSInvocation(CAT)
-@property (nonatomic, unsafe_unretained) id target;
+@property (nonatomic, assign) id target;
-@property (nonatomic, unsafe_unretained) id dataSource;
+@property (nonatomic, assign) id dataSource;
-@property (nonatomic, unsafe_unretained) id xxxdelegateYYY;
+@property (nonatomic, assign) id xxxdelegateYYY;