• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Help with relationship objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Help with relationship objects
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Assigning to property with 'readonly' atribute not allowed
  • Next by Date: Re: sorting a pair of arrays
  • Previous by thread: Re: Reading Adobe Photoshop header, Obj-C
  • Next by thread: Re: Help with relationship objects
  • Index(es):
    • Date
    • Thread