开发者

Methods of an object which implements a protocol I've created aren't called

开发者 https://www.devze.com 2023-03-08 22:51 出处:网络
I\'ve created a protocol to manage data source updates. but invoking methods of the object which implements the protocol won\'t work...

I've created a protocol to manage data source updates.

but invoking methods of the object which implements the protocol won't work...

I've checked if the objects conforms to the protocol with: conformsToProtocol

and the result is no although in the header of the object's class i've declared the protocol:

 @interface M开发者_Python百科yClass : NSObject <DataSourceProtocol> 
 {
     ...

and implemented the methods...

What could be the problem?

Thanks!


Sounds like you forget to point the DataSourceProtocol to the viewController.

Something like this in viewController:

_tableView.dataSource = self;

I can't comment the question, so I make above as an answer.

0

精彩评论

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