简体   繁体   中英

NSMutableArray alloc init deprecated in iOS9?

I am using Deploymate tool to check deprecation and iOS version compatibility, some of you might know. It is telling me

init
Deprecated in iOS 9.0

for code like

[[NSMutableArray alloc] init];

Could not find anything about deprecation. Can someone enligten me. Is this a "bug" in Deploymate or is it really deprecated? Do I need to change something to

[[NSMutableArray alloc] init];

I don't have Deploymate but it seems like it seems like it may prefer you to use [NSMutableArray new]; instead of [[NSMutableArray alloc] init]; .

However you can't use the new method if you pass in init options such as [[NSMutableArray alloc] initWithArray:@[@"Foo", @"Bar"]]; .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM