iOS/Xcode異常:no visible @interface for XXX declares the selector YYY


在iOS/Xcode開發過程中,出現如下異常信息:

no visible @interface for XXX declares the selector YYY

分析原因:

There are lots of reasons it could happen, but generally it’s saying that at the line of code it flags, it doesn’t see any evidence that the selector you are referencing is in the interface of the type it thinks the object has.

有很多原因導致這一情況發生,但是一般而言,發生異常的代碼行,指沒有在interface接口文件中,找到任何你引用的selector(方法)。

可能的原因:

  • 沒有在interface進行聲明定義
  • 字母輸入錯誤
  • 參數輸入有誤或少參數

 

舉例:

server是BulletinBoardClient類對象,其要實現BulletinBoard接口,但是其中的接口方法add和get是有參數的。

 可行修改方法:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM