Objective-C can be quite verbose, especially when handling nested data – there is no simple associative array indexing of the kind found in PHP, Ruby etc.
ObjC : verbose : id value = [map objectForKey:@”key”];
Using atx functions : concise : id value = at(map, @”key”);
This comes in very handy for deeply nested json data trees, where you might want to index a multidimensional array or nested tree – vis :
id pop = at(at(at(stats, @”USA”), @”NewYork”), @”popn”);
Not quite as simple as pop = stats[“USA”][“NewYork”][“popn”]; but more readable than several objectForKey’s. Note, I propagate the nulls up so if an item is not found at any level, it can be checked once at the top level without crashing the app.
The small suite of related functions can be found at google code here, under BSD licence – http://code.google.com/p/xathack/