我有这个Obj-C协议
@protocol MSOutlineViewControllerModelInterface
@property (weak) MSOutlineViewController *fatherController ;
@end
我有这个快速的课程
class ModelFileTree : NSObject, MSOutlineViewControllerModelInterface
{
@objc weak var fatherController : MSOutlineViewController?
}
编译器不停地告诉我"类型ModelFileTree不符合协议' MSOutlineViewControllerModelInterface' ...我无法解决任何问题......
答案 0 :(得分:1)
编译器抱怨,因为它正在将MSOutlineViewController
与MSOutlineViewController?
进行比较,这在Swift中是不同的。
试试这个:
@protocol MSOutlineViewControllerModelInterface
@property (weak) MSOutlineViewController * _Nullable fatherController ;
@end