The Issue:
In my application the user is required to first pass the login screen. Once the user successfully logs in, I store a reference to this user's core data object. My issue comes in when this user logs out and another one logs in. I currently have no way of differentiating User A data from User B data on the same device.
The calls to the server pass the user's credentials in the header, but the return has no foreign key information about the requesting user to use during mapping. I would like to set it up to simply make the relationship to the user use the stored reference.
These relationships tend to be a many-to-one (user <--->> email) or many-to-many (user <<-->> meeting).
...
{
heading: "My Email"
body: "I didn't write much",
...
},
...
Possible solutions:
- (Most Desired Solution) Perform connection during mapping
- Somehow set the RKEntityMapping to automatically make the relationship connection between the incoming objects and the referenced user
- Request the server to return the userID
- This would then allow the relationship mapping to occur using the userID key
- Manually set the relationship after mapping
- Use the success block from getObjectsAtPath:parameters:success:failure: to connect the user and newly received object
Any and all feedback is greatly appreciated. Thank you.