@interface PaneBean : NSObject
@property(nonatomic,copy) NSString *name;
@property(nonatomic,copy) NSString *type;
@property(nonatomic,assign) NSInteger width;
@end
copy
sends the copy
message the object you set, while strong
only retains it (increments the reference count).
For NSString
, or in general any inmutable class with known mutable subclasses(NSArray
, NSDictionaty
, NSSet
), copy is preffered to avoid clients setting a mutable instance and modifying it out of the object.
For primitive types(int for example) copy/strong does not make sense and by default assign is used. Is up to you if you want to put it explicitly or not.