0

What is the different between these two when using ARC in Objective-C for iOS?

NSMutableArray *anArray = [[NSMutableArray alloc] initWithArray:itemsArray];
appDelegate.wishlistItemsArray = anArray;

vs

appDelegate.wishlistItemsArray = [NSMutableArray arrayWithArray:itemsArray];

The property in appDelegate is:

@property (nonatomic, strong) NSMutableArray *wishlistItemsArray;
rmaddy
  • 307,833
  • 40
  • 508
  • 550
Ethan Allen
  • 13,766
  • 23
  • 96
  • 185

1 Answers1

3

Nope. Those methods differ only in the memory management semantics of their return value, and ARC handles memory management for you, they can be used interchangeably in an ARC program.

Chuck
  • 228,856
  • 29
  • 291
  • 386