0
@property (nonatomic, strong) NSString *dude;
@property (nonatomic) NSString *dude;
@property (nonatomic, weak) NSString *dude;

What exactly is the difference between these 3?

Esqarrouth
  • 38,543
  • 21
  • 161
  • 168

1 Answers1

2

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 *".

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215