so I have a problem: Let’s say I have Messages and Users and the information for them is stored in CoreData. There is a relation so you can code something like aMessage.SentBy.FirstName. In a table view I want to show Message titles and User’s full name. So I get the result, reload the table and the cellForRowAtIndexPath is called. What happens is if I have 3 messages from one user, only one of them would return the FirstName, the others would return “(null)”!!!
Why is that happening? Maybe I am doing something wrong :/
It sounds like your relationship from Users -> Messages is to-one. Whenever you set the SentBy relation on a Message, it overwrites the previous Message relationship on the user.
You need to make it a to-many relationship.
On your object graph, it should look like this:
User <——>> Message