Get Subscripting for iOS Today
When I watched the WWDC video for Modern Objective-C, I was really excited to see that they had made some really cool changes to make the language much less verbose and much simpler.
Objective-C now supports subscripting for NSDictionaries and NSArrays. Here is a simple example comparing the old versus the new way of creating an NSDictionary:
All this syntactic sugar is available in Xcode 4.4, but I quickly learned that even though the compiler can support this syntax,
So after some googling around I saw this article and found out that all that was needed was that it is possible by providing a header file with the following methods:
Word of caution when using this interface; you will be able to use the subscript syntax with
Hopefully next year Apple will make even more changes to Objective-C. Maybe we'll see something like this: