Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData implementation of persons with any number of assets



Hello,

I'm trying to implement an application using CoreData where I have a person
entity and an asset entity. A person entity has a to-many relationship to
the asset entity and vice-versa. However, I want each person instance to
specify their own quantity of any of the assets. How should I keep track of
the quantity each person wants of each asset?


This is what I tried with some Good and some Bad behavior. I gave the asset entity a name and a quantity attribute. The user selects from the list of assets to assign to a person. The selected asset instances are added to the person's NSMutableSet of assets. The Good here is that if the user edits an asset name, every person who's selected that asset will know the new name. I want to keep this behavior. The Bad here is that the quantity attribute is also shared and this should be unique to each person for a given asset.


What's the right way to implement the behavior I've described using CoreData?


Andres _______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.