Object Mapping library from JSON to NSObjects

Why not add mappings for classes?

+ (NSDictionary *)mapClasses {
    return @{
            @"category": [Category class],
            // ...
    };
}

For non-container properties, you could even do runtime introspection of properties to avoid redundant mappings.

Container properties could map to special wrapper objects:

[OMContainer arrayWithClass:Key.class], @"keys",
[OMContainer dicionaryWithKeyClass:ScopeID.class valueClass:Scope.class], @"possibleScopes",

Or even blocks for dynamic selection of types:

[OMDynamicType typeWithBlock:^(id obj){
    if ([obj isKindOfClass:NSString.class] && [obj hasPrefix:@"foo"])
        return Foo.class;
    else
        return Bar.class;
}], @"foo", 

Implementing this could go something like:

+ (NSArray *)parseData:(NSData*)jsonData intoObjectsOfType:(Class)objectClass {
    NSArray *parsed = /* ... */
    NSMutableArray *decoded = [NSMutableArray array];
    for (id obj in parsed) {
        [decoded addObject:[self decodeRawObject:parsed intoObjectOfType:objectClass]];
    }
    return decoded;
}

+ (id)decodeRawObject:(NSDictionary *)dict intoObjectOfType:(Class)objectClass {
    // ...
    NSDictionary *jsonKeys = objectClass.mapProperties;
    NSDictionary *jsonClasses = objectClass.mapClasses;

    for (NSString *key in jsonKeys.allKeys) {
        NSString *objectProperty = jsonKeys[key];
        NSString *value = dict[key];
        if (value) {
            id klass = jsonClasses[key];
            if (!klass) {
                [entity setValue:value forKey:objectProperty];
            } else if (klass == klass.class) {
                [entity setValue:[self decodeRawObject:value intoObjectOfType:klass]
                          forKey:objectProperty];
            } else if (/* check for containers and blocks */) {
                // ...
            }
        }
    }
    // ...
}

Consider using RestKit: http://restkit.org

This framework has all you need — REST and JSON abstractions, object mapping, even Core Data support and a lot of really useful stuff, all implemented in a customizable and elegant manner.

UPDATE: Ok, while writing yet another mapping method, I decided I can't do it anymore and done a small framework. It introspects object's properties, and with a little tuning gives you free pretty description, isEqual/hashCode, free NSCoding support, and allows generating to/from JSON mappers (ok, actually, NSDictionary, but who would use it for something else). All NSNull-checks, missing fields in JSON, new unexpected fields in JSON are handled gracefully and reported properly.

If anybody wants this shared to the public, you could give me some upvotes or comments. I'd do that eventually, but I might consider sharing it faster.