Cannot find protocol declaration for 'xxDelegate'
2017-03-28 11:09
253 查看
之前用Xcode8编写工程,我今天用Xcode7.3打开工程竟然报Cannot find protocol declaration for 'CAAnimationDelegate'的错误,说是找不到代理方法,因为是引用的三方,所以我慢慢找了一下,是因为编译器编译顺序的问题,打个比方你在b.h里自定义了一个代理bDelegate,如果程序在编译a.h文件但是你 #import
了b.h文件,编译器就会去编译 b.h 的文件,而b.h #import 了c.h的文件,编译器就跑到c类,当c.h 遵守了bDelegate,但是b.h 的代理语句还没有加载,所以就报找不到代理的错误!
------ 解决方法:删除#import c.h 或者 调一下代理语句顺序,尽可能让编译器显读取到代理语句。
了b.h文件,编译器就会去编译 b.h 的文件,而b.h #import 了c.h的文件,编译器就跑到c类,当c.h 遵守了bDelegate,但是b.h 的代理语句还没有加载,所以就报找不到代理的错误!
------ 解决方法:删除#import c.h 或者 调一下代理语句顺序,尽可能让编译器显读取到代理语句。
相关文章推荐
- Cannot find protocol declaration for "XXDelegate" 找不到协议错误
- cannot find protocol declaration for "RefreshAudioListViewDelegate”
- cannot find protocol declaration for "RefreshAudioListViewDelegate"
- iOS-Error:Cannot find protocol definition for 'TencentSessionDelegate'
- ios error:Cannot find protocol declaration for
- Delegate Cannot find protocol declaration
- cannot find protocol definition for 'TencentSessionDelegate'
- Cannot find protocol definition for 'TencentSessionDelegate'
- iOS集成支付宝遇到的问题一:Cannot find interface declarationfor'NSObject', superclass of'Base64'
- Cannot find interface declaration for 'NSObject'报错
- Cannot find interface declaration for “类B”,superclass of “类A”
- 带有framework时,OC/swift混合编译时,报错MyClass is unavailable: cannot find Swift declaration for this class
- swift 调用 oc [cannot find interface declaration for ‘ BaseViewModel’ , superclass of ‘indexViewModel’
- <Cannot find protocol declaration>
- Static Library: Cannot find interface declaration for 'UIImage'
- 解决Invalid derived query! No property find found for type XX的问题
- Cannot find an initializer for type '[(String)]' that accepts an argument list of type '(LazyForward
- Struts2 : Cannot find the tag library descriptor for /struts-tags in JSP 错误的可能原因
- iOS: UIScrollViewDelegate Protocol的方法viewForZoomingInScrollView:
- java.lang.UnsatisfiedLinkError: No implementation found for int com.xxx.xx中的couldn’t find “XX.so”或loadLibrary("xxx")失败