Search code examples
iosios5ios6

Safe to use @{key: object>} and @[objects] in iOS 5


Can I use the shorter version of a NSArray and NSDictionary that was announced in iOS 6.0 in iOS 5.0 or will my app crash?

I'm using Xcode 4.6.2


Solution

  • I'm using them & my app isn't crashing. This is because they are compiler features. So as long as you have the right version of Xcode and clang (if @[objects] works then you have the right version], it will know that you means to create an array or dictionary and create the right binary code for that. iOS 5/6 won't know what your source code looked like.