The mystery of the missing inverse relationship (was: Re: Fun (or not) with NSArrayControllers and CoreData.)
The mystery of the missing inverse relationship (was: Re: Fun (or not) with NSArrayControllers and CoreData.)
- Subject: The mystery of the missing inverse relationship (was: Re: Fun (or not) with NSArrayControllers and CoreData.)
- From: Daniel DeCovnick <email@hidden>
- Date: Fri, 31 Jul 2009 17:19:25 -0700
On Jul 31, 2009, at 3:41 PM, Quincey Morris wrote:
Still, it's slightly disconcerting that setting the property
doesn't set the inverse relationship. How are you supposed to
change it later?
I believe it *was* setting the inverse correctly, just not KVO-
compliantly. That is, your data model was correct, but the user
interface was out-of-date.
I don't think that's it, since even if I restarted the app after
adding jobs, I couldn't see anything in the table, whereas if I didn't
bind the content set of the jobs array controller at all, they showed
up correctly. Meh, I'll just follow this pattern in the future and
avoid setting from the one side of a one-to-many relationship.
On a mostly unrelated note, is the only way to suppress the "no '-
addJobsObject:'/'-addAllDescendantsJobsObject:' method found"
warnings to create the Folder custom subclass and paste the Core
Data method declarations in? That approach seems like overkill
since I have nothing to customize in it.
I forgot, you can't use @dynamic because these aren't properties.
What you can do is put the method declarations in a category of your
subclass, and just not implement the category. See Xcodes's Design --
> Data Model --> Copy Obj-C 2.0 Method Declarations to Clipboard as
a way of avoiding re-inventing this for yourself. (But delete any
#ifdef'd stuff it gives you -- that's only if you're actually re-
implementing the methods.)
I can put these in any included .h file, right? I don't have a custom
subclass of Folder at all at the moment.
_______________________________________________
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