最初,我在LoginViewController.m中包含以下警告的文件,我忽略了它。代码工作正常。将目标C文件扩展名从.m更改为.mm会导致错误
warning: sending 'LoginViewController *' to parameter of incompatible type 'id<NSStreamDelegate>'
但现在我把文件扩展名改为.mm(LoginViewController.mm)。由于这个错误,现在我不能再构建项目了。
Cannot initialize a parameter of type 'id<NSStreamDelegate>' with an lvalue of type 'LoginViewController *'
怎么了?
甚至没有。他只需要遵守协议! – CodaFi 2013-03-08 23:10:23
@CodaFi:哦,你说得对。我精辟地剔除了错误的实际细节,并假设它是我在Objective-C++中经常遇到的那种事情。 – Chuck 2013-03-08 23:11:30
我可以看到发生了!我知道当我看到左值时,轮子开始转动。 – CodaFi 2013-03-08 23:42:58