Skip to content

Custom RLMObject to JSON mapping (symmetric method to +preprocessedJSON needed) #92

@pankkor

Description

@pankkor

If I want to make any complicated preprocessing on JSON before mapping JSON to RLMObject I can use +preprocessedJSON:, but there is no way for opposite postprocessing of RLMObject to JSON if I want to get the same JSON back from RLMObject.

One way I wanted to achieve that is by overriding -JSONDictionary but it is implemented this way:
- (NSDictionary *)JSONDictionary { return [self mc_createJSONDictionary]; }
and everywhere in the implementation -mc_createJSONDictionary is called. So suddenly to achieve what I want I need to override -mc_createJSONDictionary and mess with guts of implementation because -mc_createJSONDictionary is private.

  1. Why can't -JSONDictionary be called directly in the implementation?
  2. Do you have any plans to introduce a symmetric call to +preprocessedJSON:?
  3. Are there any other ways I can achieve desired behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions