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 7789315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:15:42+00:00 2026-06-01T21:15:42+00:00

I have a custom class (subclass of NSView – actually let’s say a modified

  • 0

I have a custom class (subclass of NSView – actually let’s say a modified editor, but NOT a subclass of NSTextView) which I’m binding to an NSArrayController programmatically (I most definitely canNOT do it via Interface Builder), like this :

[myEditor bind:@"string" 
     toObject:myController 
  withKeyPath:@"selection.content" 
      options:nil];

The above works, however when the value is changed, it is NOT updated to my NSArrayController – it’s as if it doesn’t “stick”.

I’ve even tried, using the options below, but to no avail :

NSDictionary* options = [NSDictionary dictionaryWithObjectsAndKeys:
                         [NSNumber numberWithBool:YES],NSContinuouslyUpdatesValueBindingOption, 
                         [NSNumber numberWithBool:YES],NSAllowsEditingMultipleValuesSelectionBindingOption,
                         [NSNumber numberWithBool:YES],NSConditionallySetsEditableBindingOption,
                         [NSNumber numberWithBool:YES],NSRaisesForNotApplicableKeysBindingOption,
                         nil];

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 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-06-01T21:15:43+00:00Added an answer on June 1, 2026 at 9:15 pm

    A class has to implement support for bindings. The view and cell classes that come with Cocoa generally implement a particular set of bindings. Whether custom subclasses do or not is up to the implementer.

    If a class hasn’t implemented specific support for a binding, then a -bind:... request falls through to NSObject‘s implementation. However, that implementation is quite limited. It observes the key path for the observableController, and updates via KVC the property of the receiver having the same name as the binding. But it does not go in the other direction. That is, changes to the property on the receiver are not forwarded to the observableController via the key path.

    To make this less abstract using your example. If the class of myEditor has not specifically implemented support for a “string” binding, then NSObject‘s implementation will do [myController addObserver:<some private observer object> forKeyPath:@"selection.content" options:<...> context:<...>].

    When the private observer object receives a change notification, it will do [myEditor setValue:[myController valueForKeyPath:@"selection.content"] forKey:@"string"].

    However, NSObject will make no attempt to observe myEditor‘s “string” property nor ever call [myController setValue:<...> forKeyPath:@"selection.content"].

    To learn more about how to implement support for a binding, see Apple’s documentation.

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

Sidebar

Related Questions

In my Cocoa Application I have created a Custom View Class (subclass of NSView),
I am writing a custom NSView subclass. I have several instances of this class
I have created a subclass of UITableViewController that is used as the custom class
I have a custom class say 'MyCanvas' derived from wpf Canvas class. MyCanvas has
Bit of a noob question but: I have a custom class defined as: public
Here's the scenario - I have created a custom NSView subclass, and the implementation
I have a custom view class which is a subclass of UITableViewCell. I have
i have created a custom view class which is a subclass of UIview class
I have a layer-hosting view set up like this in a custom NSView subclass:
I have a custom NSTextField sub-class with a custom drawRect: implementation. The text field

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.