views:

61

answers:

2

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.

+1  A: 

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.

Wevah
+1  A: 

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.

Girish Kolari