• 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
How hard is it to make a NSOrderedSetController?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How hard is it to make a NSOrderedSetController?


  • Subject: How hard is it to make a NSOrderedSetController?
  • From: Daryle Walker <email@hidden>
  • Date: Sat, 18 Feb 2017 18:44:38 -0500

I’m using a NSValueTransformer object to convert my Core Data to-many ordered relationship from a NSOrderedSet to a NSArray so NSArrayController can use it. I just connected a NSButton to the controller’s “add:” action. I get this:

> NSManagedObjects of entity 'Message' do not support -mutableArrayValueForKey: for the property ‘header'

So it seems that the controller skips my converted value and tries to alter the property directly, which it can’t. I thought that the problem was that NSOrderedSet.array returns an array of funny proxies, but manually copying to a NSMutableArray and returning that didn’t work either. So it seems that I have to make custom actions to add objects, and hopefully the controller will see the changes.

But I’m wondering if I should go nuclear and create the NSOrderedSetController that Apple should have done years ago. I don’t know how hard this’ll be. It would be a serving-side Binding class. It would inherit from NSObjectController since NSArrayController would have those extra NSArray/NSSet connection methods.

Does the Bindings section of the Interface Builder section of Xcode hard-code the Bindings list, or will it create entries for custom Binding-capable classes? If the answer is no customization, then I would have to connect the NSManagedObject instance to the controller in code.

—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

_______________________________________________

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: How hard is it to make a NSOrderedSetController?
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: A horizontal line rule within a NSAttributedString?
  • Next by Date: Re: A horizontal line rule within a NSAttributedString?
  • Previous by thread: Re: A horizontal line rule within a NSAttributedString?
  • Next by thread: Re: How hard is it to make a NSOrderedSetController?
  • Index(es):
    • Date
    • Thread