dosi
dosi

Reputation: 476

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

What methods should be implemented?

I've tried to set the TableDataSource as 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.

Upvotes: 0

Views: 884

Answers (2)

Girish Kolari
Girish Kolari

Reputation: 2515

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.

Upvotes: 1

Wevah
Wevah

Reputation: 28242

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.

Upvotes: 1

Related Questions