• 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
Re: NSArrayController & NSTableView selectionIndexes bug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController & NSTableView selectionIndexes bug


  • Subject: Re: NSArrayController & NSTableView selectionIndexes bug
  • From: William Turner <email@hidden>
  • Date: Tue, 5 Feb 2008 14:46:28 -0800

Hi Rob,

When you see something receiving valueForUndefinedKey, it's probable that the wrong object is receiving the message. In this case, "selection" is an NSArrayController key, but it's being sent to an NSString. Beyond that, I'm not sure, without seeing some code or getting more detail on how things are set up. Somebody else might have more ideas.

How are you adding the objects to the array? Via -[NSArrayController add] or another method? When you say the array is "in" the custom view, do you mean it's an iVar in that object? The array should probably be an iVar in your AppController, the array controller's contentArray should be bound to it, and the table columns and custom view bound to the array controller.

Wil

On Feb 5, 2008, at 1:45 PM, Rob Redpath wrote:

Hi,

I'm writing an app that has a table containing data on one side of a split view, with its columns bound to an NSArrayController, and an NSView subclass on the other side. It's not a document-based app so I have an AppController class instantiated in IB with two outlets - one for the the NSView subclass, the other for the arrayController. I can add and delete rows from the table just fine, and display the info from the current selection in the custom view, all ok.

The problem I'm having is that whenever I create two or more rows in the table and switch between them the following appears in the debug console:

2008-02-05 21:20:29.770 GanttXv4[22988:10b] Error setting value for key path selectionIndexes of object <NSArrayController: 0x134dd0>[object class: NSMutableDictionary, number of selected objects: 1] (from bound object <NSTableView: 0x129a30> with object ID 432 in Nib named MainMenu.nib): [<NSCFString 0x191950> valueForUndefinedKey:]: this class is not key value coding-compliant for the key selection.

At first I thought this was related to the fact that I've bound arrayController.arrangedObjects to an NSMutableArray in the custom view, as I want it to display the data for the whole table, not just the current selection, but I've rolled my code back to before that happened and it persists. It doesn't seem to affect the program's execution but I don't want to run into problems later.

So my questions are:
- Any idea what causes that problem?
- Am I going about the overall problem the right way?

Thanks

Rob
_______________________________________________

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

_______________________________________________

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


References: 
 >NSArrayController & NSTableView selectionIndexes bug (From: Rob Redpath <email@hidden>)

  • Prev by Date: Re: CoreData: Can't modify an immutable model
  • Next by Date: Transferring data between Python and Cocoa (maybe a newbie question)
  • Previous by thread: NSArrayController & NSTableView selectionIndexes bug
  • Next by thread: Re: NSArrayController & NSTableView selectionIndexes bug
  • Index(es):
    • Date
    • Thread