Re: Uncaught Exception: NSUnknownKeyException
Re: Uncaught Exception: NSUnknownKeyException
- Subject: Re: Uncaught Exception: NSUnknownKeyException
- From: Donald Hall <email@hidden>
- Date: Fri, 09 Mar 2012 14:32:35 -0700
Thanks to Mike and Graham for the replies.
I think I figured out where the problem was. I am putting data into an NSTableView, with one ivar from the Action class in each column. My original project was so old that it used nibs instead of xibs, so I redid them all. In the new Xcode there doesn't seem to be a way to specify the column identifier for the xib in the Attributes Inspector, and I forgot about this, so each column has an identifier of nil or null. I believe this explains the error message. Here is the top part of the stack trace:
0 CoreFoundation 0x918ded87 __raiseError + 231
1 libobjc.A.dylib 0x9b7f1149 objc_exception_throw + 155
2 Foundation 0x9548bd78 -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 285
3 Foundation 0x953b1b97 _NSGetUsingKeyValueGetter + 39
4 Foundation 0x953b1b68 -[NSObject(NSKeyValueCoding) valueForKey:] + 406
5 Script Timer 0x00014991 -[MyDocument tableView:objectValueForTableColumn:row:] + 3249
6 AppKit 0x907c5c71 -[NSTableView _dataSourceValueForColumn:row:] + 69
7 AppKit 0x907c55e7 -[NSTableView preparedCellAtColumn:row:] + 420
8 AppKit 0x907d6c6c -[NSTableView _drawContentsAtRow:column:withCellFrame:] + 50
It looks like I'll either have to specify the identifiers in code or implement the new way to handle table columns using bindings. I will study the "NSTableViewBinding" sample project.
Thanks again, Don
On 2012-03-09, at 2:35 AM, Graham Cox wrote:
>
> On 09/03/2012, at 5:57 PM, Donald Hall wrote:
>
>> s class is not key value coding-compliant for the key (null).
>
>
> The key is nil (null). So the problem is where the key is coming from, not the operation of the Action class.
>
> --Graham
_______________________________________________
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