clang 报告未Test1(FooBar)实现fooor bar,尽管 foo 已在. 由于's存在于's 之上,clang 应该看到该实现并且不应该要求我在. 由于implements ,clang 不应该要求我在.Test1(Foo)barTest1Test1(Foo)@interfaceTest1(FooBar)Test1(Foo)fooTest1(FooBar)Test1barTest1(FooBar)
@interface Test1 : NSObject
- (void) bar;
@end
@interface Test1(Foo)
- (void) foo;
@end
@protocol FooBar <NSObject>
- (void) foo;
- (void) bar;
@end
@interface Test1(FooBar)<FooBar>
@end
@implementation Test1(Foo)
- (void) foo {
}
@end
@implementation Test1(FooBar)
@end