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
  • 314,917
  • 42
  • 532
  • 579
Ethan Allen
  • 14,425
  • 24
  • 101
  • 194

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
  • 234,037
  • 30
  • 302
  • 389