Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binding are not working on NSTableView. #87

Closed
gcasa opened this issue Oct 6, 2020 · 6 comments
Closed

Binding are not working on NSTableView. #87

gcasa opened this issue Oct 6, 2020 · 6 comments

Comments

@gcasa
Copy link
Member

gcasa commented Oct 6, 2020

Currently I have two examples in my repository NSArrayController_test and NSDictionaryController_test. I am currently working on implementing NSDictionaryController, so I will cover NSArrayController here.

  1. build the NSArrayController_test example
  2. run

Expected: you should get a table with one column with three rows being 1,2, & 3.
Actual: You get nothing.

Currently, the bindings are not causing the NSTableView to show the results as it is under macOS:
NSArrayController

@digital-pers0n
Copy link

Have you tried to bind NSTableColumn programmatically? For cell-based table views it should be something like this:

    NSTableColumn *column = [myTableView tableColumnWithIdentifier: @"column"];
    [column bind: NSValueBinding
        toObject: myArrayController
     withKeyPath: @"arrangedObjects.someKey"
         options: nil];

@gcasa
Copy link
Member Author

gcasa commented Nov 4, 2020 via email

@fredkiefer
Copy link
Member

The problem here seems to be that the numberOfRows for the NSTableView is not computed from the value binding of the column. I am not sure how this should be done in general, although the simple case with just one column should be easy.

@gcasa
Copy link
Member Author

gcasa commented Jan 20, 2021

One issue I am running into with this is that it seems to get into infinite recursion. I'm wondering if it might not be possible for you to take a look and see if you can understand what I am doing wrong. :(

@fredkiefer
Copy link
Member

Could you please explain what you are doing and how to reproduce the recursion issue you are seeing?
I am willing to help but first need to understand where you are going. Getting your simple example to work won't be a problem. As I wrote it is the general solution where I don't know how to processed.

@fredkiefer
Copy link
Member

I implemented that simple solution I talked about above. This should resolve this specific issue. If you have further problems, please open a new ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants