In BNR iOS book the authors say to make this copy
instead of strong
:
@property (nonatomic, copy) NSString *itemName;
But I don't really understnad the purpose because in the main
method I tried out:
BNRItem *calculator = [[BNRItem alloc] init];
NSString *pickle = @"pickbarn";
backpack.itemName = pickle;
pickle = @"fuffle";
When I printed out backpack
's name to the console it was picklebarn
, so I don't really understand why itemName
needs to be copied
?