Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1013875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:10:14+00:00 2026-05-16T10:10:14+00:00

I have a problem with a bound property of a custom view. The property

  • 0

I have a problem with a bound property of a custom view. The property is bound to an NSArrayController for a core-data entity.

Here’s the problem:

In my view, I draw several rectangles. The positions of these rectangles are saved in an entity in core data (as NSValue wrapped NSRects). The rectangles are draggable, and when I drag a rectangle, I want the entity to be updated to the new position.
But I can’t find out how to bind the arrayController back to the view.

Here is how everything is connected:

  • I have a windowController with outlets to the view and the arrayController.

  • The arrayController is bound to the managedObjectContext of the windowController and therefore to my core-data model. (That binding and the binding to the entity are established in Interface Builder)

  • The view is bound to the arrayController with an ivar „rectangleValuesArray“

That last binding is established in the windowController using:

[connectionsView bind:@"rectangleValuesArray"
             toObject:elementsArrayController
          withKeyPath:@"arrangedObjects.rectangleValue"
              options:nil];

That works so far.

Now I tried to establish the binding in the other direction with:

[elementsArrayController bind:@"arrangedObjects.rectangleValue"
                     toObject:connectionsView
                  withKeyPath:@"rectangleValuesArray"
                      options:nil];

Now when I change my ivar, the Entity should be updated (right?).
But that doesn’t work – I get that from the console:

Cocoa Bindings: Error setting value for bound property arrangedObjects.rectangleValue of object <NSArrayController: 0x200027100>[entity: Element, number of selected objects: 1]: [<NSArrayController 0x200027100> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key arrangedObjects.rectangleValue.

What am I getting wrong here? Please, somebody help?

Simon

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:10:15+00:00Added an answer on May 16, 2026 at 10:10 am

    A couple of things.

    First, the exception is correct: It isn’t possible to set the rectangle value of any NSValue objects. They’re immutable.

    It sounds like you’re trying to maintain parallel arrays, with the array of rectangles being one of them. Don’t do that; Bindings chokes on it and it makes AppleScript support much harder as well.

    What you need to do is implement model objects, and keep a single array of those. Whatever arrays you currently have, including the one of rectangles, should become properties of the model objects—each one has a rectangle, among whatever other things.

    The other thing is that you don’t bind the controller to the view; you bind the view to the controller. Having already done that, you’re done.

    You might also consider setting this up in IB instead of in code, if possible. Don’t resist using IB; it is your friend.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the problem: I have a data-bound list of items, basically a way for
I have the following setup using Core Data: Nib1: A WindowController with two custom
I have a problem with a data-bound DataGrid control, in that despite each column
another ordered delivery problem. We have an orchestration which is bound to a send
I have problem while loading data into html select when users press or click
I have problem SIMILAR to preventing form data reposting, but not quite the same
i have a repeater that is bound to a number of custom dataitems/types on
I have an Image that I have bound the 'Source' property of to the
I have a DataGridView which is data-bound to a BindingList. My DataGridView also has
I have a datagrid (A C1 datagrid, in this case) bound to a property

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.