matthewcheok / Realm-JSON

A concise Mantle-like way of working with Realm and JSON.
MIT License
661 stars 129 forks source link

Trouble understanding inner code #75

Closed Changsung closed 6 years ago

Changsung commented 8 years ago

hi I'm considering using this source on my project but I have trouble understanding under the code

- (id)mc_createJSONDictionary {
...
            id currentDictionary = result;
            for (NSString *component in keyPathComponents) {
                if ([currentDictionary valueForKey:component] == nil) {
                    [currentDictionary setValue:[NSMutableDictionary dictionary] forKey:component];
                }
                currentDictionary = [currentDictionary valueForKey:component];
            }
...
}

what is that for?