我有一个像这样定义的子类
@protocol UMTextViewDelegate;
@interface UMTexView : UITextView <UITextViewDelegate> {
}
@property (nonatomic, assign) id<UMTextViewDelegate> delegate;
@end
@protocol UMTextViewDelegate <NSObject>
@optional
- (void)textViewDidSelectWordToDefine:(UMTexView*)textView;
@end
但我收到警告Property type 'id<UMTextViewDelegate>' is incompatible with type 'id<UITextViewDelegate>' inherited from 'UITextView'
。
如何抑制此警告?我试着添加这个:
@protocol UMTextViewDelegate <NSObject, UITextViewDelegate>
但没有运气。!!
编辑:
我没有使用 ARC