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.
With ARC turned on, is there a different between alloc/init and normal autorelease methods? [duplicate]
-
31-05-2022 - |
题
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;
解决方案
不隶属于 StackOverflow