@property (nonatomic, strong) NSString *dude;
@property (nonatomic) NSString *dude;
@property (nonatomic, weak) NSString *dude;
What exactly is the difference between these 3?
@property (nonatomic, strong) NSString *dude;
@property (nonatomic) NSString *dude;
@property (nonatomic, weak) NSString *dude;
What exactly is the difference between these 3?
There's no difference between the first and second, as "strong
" is the default & implicit attribute.
The third uses a weak reference, which means that when the object is released by the last owner, the dude
property becomes nil.
Oh, lastly, NSString properties should actually be declared with "NSString *
".