【问题标题】:How to resolve the “Expected a type” error in @class in ios如何解决ios中@class中的“预期类型”错误
【发布时间】:2016-03-08 11:38:50
【问题描述】:

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

@class RateView;

@protocol RateViewDelegate <NSObject>;

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

@interface RateView : UIView

【问题讨论】:

    标签: c# ios objective-c iphone xcode


    【解决方案1】:
    @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! :)

    【讨论】:

    • 这种愚蠢的错误很难找到:p
    猜你喜欢
    • 1970-01-01
    • 2019-05-17
    • 1970-01-01
    • 1970-01-01
    • 2019-12-07
    • 1970-01-01
    • 2021-09-15
    • 1970-01-01
    • 2019-11-16
    相关资源
    最近更新 更多