At first, in LoadingVC.h I declare a protocol:
@protocol VideoWorker <NSObject>
@required
@property (nonatomic) float progress;
@property (nonatomic) BOOL done;
-(void)beginWorking;
@end
@interface LoadingVC : UIViewController <UIAlertViewDelegate>
...
@end
then in BlurWorkerGPU.h
...
#import "LoadingVC.h"
@interface BlurWorkerGPU : NSObject <VideoWorker> {
...
}
- (void)beginWorking;
@property(nonatomic)float progress;
@property(nonatomic)BOOL done;
...
@end
However, llvm says that
"No type or protocol named 'VideoWorker'"
which is strange since I am importing the header where the protocol is defined. Any clues?
You should forward declare protocol in .h files before you use it. Put this in the top of BlurWorkerGPU.h
@protocol VideoWorker;
检查是否在“LoadingVC.h”中导入“BlurWorkerGPU.h”
Possible solutions are
@import YOURPROTOCOLNAME
#import "YOURCLASSWHICHDECLAREDPROTOCOL.h"
@class YOURCLASSWHICHDECLAREDPROTOCOL;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.