• 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
KeyValuePair entity and maintaining unique keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KeyValuePair entity and maintaining unique keys


  • Subject: KeyValuePair entity and maintaining unique keys
  • From: Prachi Gauriar <email@hidden>
  • Date: Sat, 4 Mar 2006 06:10:31 -0500

Hi everyone. In the app that I'm (sporadically) working on, I want to create views that allow a great deal of customization in the way that my model objects are displayed. The way I was going to achieve that was by using dictionaries that the view objects can read in order to determine how to draw the model object. I read in the archives that the recommended approach to getting dictionary-like functionality with Core Data is to create to-many relationship to a KeyValuePair entity. I'm curious how people are handling certain aspects of this.

Let's say the class that needs a dictionary is called EntityA.

1) How does one enforce uniqueness of keys? Surely every class that needs a dictionary wouldn't need its own code to keep keys unique.

2) Should EntityA have a direct to-many relationship with KeyValuePairs, or should I create an intermediate entity called Dictionary that has the to-many relationship, and EntityA has a to- one relationship with Dictionary? I would think that creating the intermediate Dictionary entity would make it easier to handle the unique keys problem, but I'm not sure if this would foul up any other parts.

Any insight would be greatly appreciated.

-Prachi


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: how to debug notification that's never received?
  • Next by Date: bindings question
  • Previous by thread: Re: NSSlider mouseUp ????
  • Next by thread: bindings question
  • Index(es):
    • Date
    • Thread