出于调试目的,我创建的B类符合某个protocol A
。
@interface B: NSObject<A>
@end
此类型的目标在内部保存另一个对象_internalObj
,该对象也向protocol A
确认。
我还覆盖了一些方法并使用以下方法重新路由其他方法:
- (void)forwardInvocation:(NSInvocation *)anInvocation
{
if ([_internalObj respondsToSelector:
[anInvocation selector]])
[anInvocation invokeWithTarget:_internalObj];
else
[super forwardInvocation:anInvocation];
}
如何,我收到以下错误/警告(取决于我的项目设置),我没有成功压制。
"Auto property synthesis will not synthesize property 'xxxx' declared in protocol 'yyy "
我已经尝试了以下但是它没有帮助:
#pragma clang diagnostic ignored "-Wobjc-property-synthesis"
#pragma clang diagnostic ignored "-Wobjc-missing-property-synthesis"
有什么想法吗?