Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are the new object literals backwards compatible with iOS 5?

I'm trying to figure out if I should start using the recently added object literals to subscripting dictionaries, arrays and so on. This following post seems to indicate that iOS5 doesn't support them, and I read that the functionality was added in iOS6.

Is that the case? Is anybody using the new literals in iOS5 successfully?

like image 778
Alexandr Kurilin Avatar asked Oct 13 '12 03:10

Alexandr Kurilin


1 Answers

You can find details about which versions of iOS (and OS X) support which modern Objective-C features in Apple's Objective-C Feature Availability Index.

The NSNumber, NSDictionary and NSArray literals (e.g. @{ @"key": @"value" }) can be deployed to every iOS release, including iOS 5.

The NSDictionary and NSArray subscripting operators (e.g. myArray[7] or myDictionary[@"hello"]) can be deployed to iOS 5.0 and later releases.

like image 51
rob mayoff Avatar answered Sep 20 '22 14:09

rob mayoff