NSTableView 绑定和观察者
我正在尝试使用绑定向 NSTableview 添加新行。根据过去的一篇文章,我被指示在数组控制器上添加对象,并且 KVO 应该处理视图的通知。但是,
我收到以下错误:
An -observeValueForKeyPath:ofObject:change:context: message was received but not handled.
Key path: accountArray
Observed object: <AppDelegate: 0x10011e3b0>
Change: {
indexes = "<NSIndexSet: 0x102915ba0>[number of indexes: 1 (in 1 ranges), indexes: (2)]";
kind = 2;
}
我已在我的应用程序委托中添加了此观察者:
[self addObserver:self forKeyPath:@"accountArray" options:0 context:@"myContext"];
我还尝试实现observerValueforKeyPath,但当我调试我的代码时永远不会达到这一点。
我做错了什么?
I am trying to add a new row to an NSTableview using bindings. According to a past post I was instructed to addObject on the array controller and the KVO should handle the notification to the view. However,
I get the following error:
An -observeValueForKeyPath:ofObject:change:context: message was received but not handled.
Key path: accountArray
Observed object: <AppDelegate: 0x10011e3b0>
Change: {
indexes = "<NSIndexSet: 0x102915ba0>[number of indexes: 1 (in 1 ranges), indexes: (2)]";
kind = 2;
}
I have added this observer in my App Delegate:
[self addObserver:self forKeyPath:@"accountArray" options:0 context:@"myContext"];
I have also tried to implement the observerValueforKeyPath but when I debug my code never gets to this point.
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须实现该方法:
You must implement that method: