@protocol MyProtocol
- (void)foo;
- (void)bar;
@end
@interface MyClass : NSObject < MyProtocol >
@end
@implementation MyClass
// My Protocol implementation
- (void)foo {
NSLog(@"foo implementation.");
}
- (void)bar {
NSLog(@"foo implementation.");
}
@end
现在假设我决定更改MyProtocol
和删除该功能foo
。override
如果我不删除 foo 的实现(类似于C++ 中的等效关键字),是否有任何机制会给我一个编译器错误/警告?