简体   繁体   English

iPhone开发-调用协议方法(不起作用)

[英]iPhone development - calling protocol methods (not working)

Classes: Main, Modal, and Table 类:主类,模态和表

I declare a protocol in the main class and call that method from both the modal class and table class. 我在主类中声明一个协议,然后从模式类和表类中调用该方法。 Only the modal class is able to call the method. 只有模态类才能调用该方法。 The table class just ignores method call (which is written identically to the modal class - it doesn't call it and doesn't give an error). 表类只是忽略方法调用(与模态类的编写方式相同-它不会调用它,并且不会给出错误)。

What could be the problem? 可能是什么问题呢?

TL;DR: Is there anything that would limit a class from calling protocol methods? TL; DR:有什么会限制类调用协议方法的吗?

check if you set the delegate right, and the different between your Modal and table. 检查您是否设置了委托权限,以及模式和表之间的区别。 I don't think there is anything different which may influent the use of protocol between Modal and Table. 我认为Modal和Table之间没有任何可能影响协议使用的差异。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM