Help with relationship objects
Help with relationship objects
- Subject: Help with relationship objects
- From: Brad Stone <email@hidden>
- Date: Tue, 28 Jun 2011 11:40:47 -0400
I need a little guidance. Did I properly add a relationship object? I don't know what's normal in this scenario.
I referred to here: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdUsingMOs.html
I have an entity called SRNoteEntity which has a to-many relationship with SRTodoEntity in a mutableSet called "todos". When I do the following:
[thisNote addTodosObject:todoItem];
I get the below. Notice the new SRTodoEntity is properly in the todos relationship but there's also a reference to it outside of the SRNoteEntity. Intuitively, I would think there should be only one reference to it inside SRNoteEntity. This is my confusion. Why is it reference twice? How can I prevent that from happening if this isn't normal?
po [[self managedObjectContext] registeredObjects]
{(
<Note> uid:330961758011065
creationDate:2009-09-05 13:21:54 -0400
modificationDate:2009-09-06 12:41:02 -0400
todos:Relationship objects for {(
<SRTodoEntity: 0x200483d80> (entity: SRTodoEntity; id: 0x2004121e0 <x-coredata://614245CF-F03E-4F43-9D7F-98CDCB2899FA/SRTodoEntity/p1> ; data: {
note = "0x2002c4e60 <x-coredata://614245CF-F03E-4F43-9D7F-98CDCB2899FA/SRNoteEntity/p1>";
todoViewData = nil;
})
)} on 0x200448360
noteData:538
<SRTodoEntity: 0x200483d80> (entity: SRTodoEntity; id: 0x2004121e0 <x-coredata://614245CF-F03E-4F43-9D7F-98CDCB2899FA/SRTodoEntity/p1> ; data: {
note = "0x2002c4e60 <x-coredata://614245CF-F03E-4F43-9D7F-98CDCB2899FA/SRNoteEntity/p1>";
todoViewData = nil;
})
)}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden