I have a super class like this:
@protocol AOCellDelegate;
@interface AOBaseCell : UITableViewCell
@property (nonatomic, weak) id<AOCellDelegate>delegate;
// ... other stuff ...
@end
Where AOCellDelegate
is declared in a separate AOCellDelegate.h
file (not all controllers will care to be the cell delegate, so I don't want to force them to import it).
I have a subclass of AOBaseCell
that looks like this:
@protocol AOTextCellDelegate;
@interface AOTextCell : AOBaseCell
@property (nonatomic, weak) id<AOTextCellDelegate>delegate;
// ... other stuff...
@end
Where AOTextCellDelegate
is declared in AOTextCellDelegate.h
as conforming to AOCellDelegate
like this:
@protocol AOTextCellDelegate <AOCellDelegate>
// ... methods ...
@end
Xcode / Clang incorrectly gives this warning:
property type 'id<AOTextCellDelegate>' is incompatible with type 'id<AOCellDelegate>' inherited from 'AOBaseCell'
It is compatible because AOTextCellDelegate
conforms to AOCellDelegate
, but Clang can't tell this because AOTextCellDelegate.h
isn't imported in AOTextCell.h
.
How can I tell Xcode / Clang to ignore this warning on this file only?
Per this other StackOverflow question, I believe that I need to use #pragma
to ignore it. However, I don't see a warning identifier specified in the log (just the above message).