今天写demo的时候用到了很早版本的第三方框架,直接给我报了4个错误,当然这是正常的,错误如下:
Auto property synthesis will not synthesizeproterty;it will be implemented by its superclass, use @dynamic to acknowledge intention
意思是编译器自动给属性title合成getter和setter的时候将会在它的父类上实现,也就是说xcode在升级之后控制器里也有一个title属性,现在不知道它到底是哪一个title. 可以通过添加@dynamic告诉编译器这个属性是动态的,意思就是等你编译的时候就知道了它只在此类中合成.
代码如下:
@interface JBBarChartView : JBChartView
//These Two Lines Have The Error
@property (nonatomic, weak) id<JBBarChartViewDataSource, superclassDataSourceIfAvailable> dataSource;
@property (nonatomic, weak) id<JBBarChartViewDelegate, superclassDelegateIfAvailable> delegate;
@end
//MARK:dynamic
@implementation JBBarChartView
@dynamic dataSource;
@dynamic delegate;
@end
//MARK:explicitly synthesize
@implementation JBBarChartView
@synthesize dataSource;
@synthesize delegate;
@end