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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With