I am working in the iPhone messaging app. Am using coredata to store the messages(Sent by the user and received from the webservice), username, date and time. I want to save the username once and add the send/received messages and date to the corresponding username.
Like this way:
No Name Date ReceivedMessage SendMessage
1 Gopinath 27 june, 12.01pm Hi ----
27 june, 12.02pm ---- Hello
2 ABCD 26 june, 1.01pm Hi ----
26 june, 2.02pm ---- Hello
27 june, 8pm Hi Gopi ----
Received messages should be store when i receive from service and Sendmessage will be stored when the user composed and send the message.
Can anyone please help me how to store the data like this using CoreData in my project? Thanks in advance.
Create an entity with the following attributes:
And Messages are created with: