'Existing ivar 'delegate' for unsafe_unretained property 'delegate' must be __unsafe_unretained

前端 未结 6 781
谎友^
谎友^ 2020-12-25 11:30

I\'m getting the error above, but unsure how to go about fixing it. This is my code:

.h:

#import 

@protocol ColorLineDelegate &         


        
6条回答
  •  执念已碎
    2020-12-25 11:31

    Looks like your project might be using ARC then properties should be declared this way:

    #import 
    
    @protocol ColorLineDelegate 
    -(void)valueWasChangedToHue:(float)hue;
    @end
    
    @interface ColorLine : UIButton 
    @property (nonatomic, weak) id  delegate;
    @end
    

提交回复
热议问题