开发者

Class 'TableDataSource' does not implement the 'NSTableViewDelegate' protocol

What methods should be implemented?

I've tried to set the TableDataSource 开发者_如何学JAVAas a delegate to my TableView, but delegate methods wasn't called. After that I tried to set "TableDataSource" as delegate in code, and got this warning:

warning: class 'TableDataSource' does not implement the 'NSTableViewDelegate' protocol

Delegate methods still not called.


Make sure your interface start looks like this:

@interface TableDataSource : SomeSuperclass <NSTableViewDelegate>

(where SomeSuperclass is your actual superclass)

That should get rid of the warning, at any rate.


TableView: data source and delegate have their own use, if you need data source set data source (setDataSource:) and pass object which implement NSTableViewDataSource protocol or if you need delegate set delegate (setDelegate:) and pass object which implement NSTableViewDelegate protocol.

Very important you can not just set data source as delegate and delegate as data source, object should have implemented respective protocol to set it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜