• 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
editing an entire NSManagedObject with a formatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

editing an entire NSManagedObject with a formatter


  • Subject: editing an entire NSManagedObject with a formatter
  • From: Paul Forgey <email@hidden>
  • Date: Thu, 8 Sep 2005 12:32:33 -0700

I have an entity which has a natural text representation that I'd rather have the user see and edit. I successfully accomplished this by subclassing NSManagedObject for my entity and providing a transient attribute that:

1) triggers change notifications for the three other dependent keys for the transient one
2) parses the text when changed and changes the three dependent keys
3) formulates the text when accessed from those three keys


As nicely as that works, I'm just doing that for the benefit of any UI controls using the entity. Wouldn't it be better to use a formatter that can do this with an instance of the managed object instead?

I tried doing this in a table view. I set the column's formatter, and set the binding for the column in IB to arrangedObjects (no key path) from the array controller. This gives:

2005-09-08 12:17:28.099 FoodFight[2288] *** -[ManagedIngredient copyWithZone:]: selector not recognized [self = 0x3e3040]
2005-09-08 12:17:28.115 FoodFight[2288] Cocoa Bindings: Error setting value <ManagedIngredient: 0x3e3040> (entity: Ingredient; id: 0x39fbd0 <x-coredata:///Ingredient/t6465A6BD-2536-4256-8A6D-3FBC3D2B325F> ; data: {
ingredient = nil;
ingredientExpression = "";
line = 0;
measure = nil;
quantity = nil;
recipe = 0x3d71f0 <x-coredata:///Recipe/tF55A9044-A65D-4F5D- B520-62B221D27139>;
}) of object <NSTextFieldCell: 0x382990> through binding value


Where did I get confused?

_______________________________________________
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: can you change the highlight color of an NSSegmentedControl?
  • Next by Date: [Moderator] Cocoa and list resources
  • Previous by thread: can you change the highlight color of an NSSegmentedControl?
  • Next by thread: [Moderator] Cocoa and list resources
  • Index(es):
    • Date
    • Thread