如何解决ios中@class中的“预期类型”错误

时间:2020-12-18 16:34:11

Here is my code. It showing 'Expected a type' error in first line.

这是我的代码。它在第一行显示“预期类型”错误。

@class RateView;

@protocol RateViewDelegate <NSObject>;

- (void)rateView:(RateView *)rateView ratingDidChange:(float)rating;
@end

@interface RateView : UIView

1 个解决方案

#1


0  

@class RateView;

@protocol RateViewDelegate<NSObject>   /* Remove Semi colon after declaring the protocol,seems the mistake is here only! */

-(void)rateView:(RateView *)rateView ratingDidChange:(float)rating;

@end

@interface RateView : UIView

@end

HTH! :)

#1


0  

@class RateView;

@protocol RateViewDelegate<NSObject>   /* Remove Semi colon after declaring the protocol,seems the mistake is here only! */

-(void)rateView:(RateView *)rateView ratingDidChange:(float)rating;

@end

@interface RateView : UIView

@end

HTH! :)