Ios Xcode 6.3-自动属性合成不会合成属性
错误: 自动属性合成不会合成属性“Ios Xcode 6.3-自动属性合成不会合成属性,ios,objective-c,xcode6.3,Ios,Objective C,Xcode6.3,错误: 自动属性合成不会合成属性“委托””。它将由其超类实现,使用@dynamic确认意图 错误代码:@属性(非原子,弱)id委托 任何帮助都将不胜感激,谢谢 这是我的代码: #import "JBChartView.h" @class JBBarChartView; @protocol JBBarChartViewDataSource <JBChartViewDataSource> @required /** * The number of bars in a give
委托”
”。它将由其超类实现,使用@dynamic
确认意图
错误代码:@属性(非原子,弱)id委托代码>
任何帮助都将不胜感激,谢谢
这是我的代码:
#import "JBChartView.h"
@class JBBarChartView;
@protocol JBBarChartViewDataSource <JBChartViewDataSource>
@required
/**
* The number of bars in a given bar chart is the number of vertical views shown along the x-axis.
*
* @param barChartView The bar chart object requesting this information.
*
* @return Number of bars in the given chart, displayed horizontally along the chart's x-axis.
*/
- (NSUInteger)numberOfBarsInBarChartView:(JBBarChartView *)barChartView;
@optional
/**
* A UIView subclass representing the bar at a particular index.
*
* Default: solid black UIView.
*
* @param barChartView The bar chart object requesting this information.
* @param index The 0-based index of a given bar (left to right, x-axis).
*
* @return A UIView subclass. The view will automatically be resized by the chart during creation (ie. no need to set the frame).
*/
- (UIView *)barChartView:(JBBarChartView *)barChartView barViewAtIndex:(NSUInteger)index;
@end
@protocol JBBarChartViewDelegate <JBChartViewDelegate>
@required
/**
* Height for a bar at a given index (left to right). There is no ceiling on the the height;
* the chart will automatically normalize all values between the overal min and max heights.
*
* @param barChartView The bar chart object requesting this information.
* @param index The 0-based index of a given bar (left to right, x-axis).
*
* @return The y-axis height of the supplied bar index (x-axis)
*/
- (CGFloat)barChartView:(JBBarChartView *)barChartView heightForBarViewAtIndex:(NSUInteger)index;
@optional
/**
* Occurs when a touch gesture event occurs on a given bar (chart must be expanded).
* and the selection must occur within the bounds of the chart.
*
* @param barChartView A bar chart object informing the delegate about the new selection.
* @param index The 0-based index of a given bar (left to right, x-axis).
* @param touchPoint The touch point in relation to the chart's bounds (excludes footer and header).
*/
- (void)barChartView:(JBBarChartView *)barChartView didSelectBarAtIndex:(NSUInteger)index touchPoint:(CGPoint)touchPoint;
- (void)barChartView:(JBBarChartView *)barChartView didSelectBarAtIndex:(NSUInteger)index;
/**
* Occurs when selection ends by either ending a touch event or selecting an area that is outside the view's bounds.
* For selection start events, see: didSelectBarAtIndex...
*
* @param barChartView A bar chart object informing the delegate about the deselection.
*/
- (void)didDeselectBarChartView:(JBBarChartView *)barChartView;
/**
* If you already implement barChartView:barViewAtIndex: delegate - this method has no effect.
* If a custom UIView isn't supplied, a flat bar will be made automatically (default color black).
*
* Default: if none specified - calls barChartView:barViewAtIndex:.
*
* @param barChartView The bar chart object requesting this information.
* @param index The 0-based index of a given bar (left to right, x-axis).
*
* @return The color to be used to color a bar in the chart.
*/
- (UIColor *)barChartView:(JBBarChartView *)barChartView colorForBarViewAtIndex:(NSUInteger)index;
/**
* The selection color to be overlayed on a bar during touch events.
* The color is automatically faded to transparent (vertically). The property showsVerticalSelection
* must be YES for the color to apply.
*
* Default: white color (faded to transparent).
*
* @param barChartView The bar chart object requesting this information.
*
* @return The color to be used on each bar selection.
*/
- (UIColor *)barSelectionColorForBarChartView:(JBBarChartView *)barChartView;
/**
* Horizontal padding between bars.
*
* Default: 'best-guess' algorithm based on the the total number of bars and width of the chart.
*
* @param barChartView The bar chart object requesting this information.
*
* @return Horizontal width (in pixels) between each bar.
*/
- (CGFloat)barPaddingForBarChartView:(JBBarChartView *)barChartView;
@end
@interface JBBarChartView : JBChartView
//These Two Lines Have The Error
@property (nonatomic, weak) id<JBBarChartViewDataSource> dataSource;
@property (nonatomic, weak) id<JBBarChartViewDelegate> delegate;
//.
/**
* Vertical highlight overlayed on bar during touch events.
*
* Default: YES.
*/
@property (nonatomic, assign) BOOL showsVerticalSelection;
/*
* Bars can be (vertically) positoned top to bottom instead of bottom up.
* If this property is set to YES, both the bar and the selection view will be inverted.
* For the inverted orientation to take effect, reloadData must be called.
*
* Default: NO.
*/
@property (nonatomic, assign, getter=isInverted) BOOL inverted;
@end
#导入“JBChartView.h”
@类JBBarChartView;
@协议JBBarChartViewDataSource
@必需的
/**
*给定条形图中的条形数是沿x轴显示的垂直视图数。
*
*@param barchart查看请求此信息的条形图对象。
*
*@返回给定图表中的条数,沿图表的x轴水平显示。
*/
-(NSUTEGER)BarsInBarChartView的编号:(JBBarChartView*)barChartView;
@可选的
/**
*表示特定索引处的条的UIView子类。
*
*默认值:纯黑UIView。
*
*@param barchart查看请求此信息的条形图对象。
*@param index给定条的从0开始的索引(从左到右,x轴)。
*
*@返回UIView子类。视图将在创建期间由图表自动调整大小(即,无需设置框架)。
*/
-(UIView*)barChartView:(JBBarChartView*)barChartView barViewAtIndex:(NSUInteger)索引;
@结束
@协议JBBarChartViewDelegate
@必需的
/**
*给定索引处的条形高度(从左到右)。高度上没有天花板;
*图表将自动标准化总最小高度和最大高度之间的所有值。
*
*@param barchart查看请求此信息的条形图对象。
*@param index给定条的从0开始的索引(从左到右,x轴)。
*
*@返回所提供条索引的y轴高度(x轴)
*/
-(CGFloat)barChartView:(JBBarChartView*)barChartView高度用于BarViewAtIndex:(NSInteger)索引;
@可选的
/**
*在给定条形图上发生触摸手势事件时发生(图表必须展开)。
*并且选择必须发生在图表的范围内。
*
*@param barChartView一个条形图对象,通知代理有关新选择的信息。
*@param index给定条的从0开始的索引(从左到右,x轴)。
*@param touchPoint与图表边界相关的接触点(不包括页脚和页眉)。
*/
-(void)barChartView:(JBBarChartView*)barChartView didSelectBarAtIndex:(nsInteger)索引接触点:(CGPoint)接触点;
-(void)barChartView:(JBBarChartView*)barChartView didSelectBarAtIndex:(NSInteger)索引;
/**
*通过结束触摸事件或选择视图边界之外的区域来结束选择时发生。
*有关选择开始事件,请参阅:didSelectBarAtIndex。。。
*
*@param barChartView通知代理取消选择的条形图对象。
*/
-(void)barChartView:(JBBarChartView*)barChartView;
/**
*如果已实现barChartView:barViewAtIndex:delegate,则此方法无效。
*如果未提供自定义UIView,将自动生成一个平面条(默认颜色为黑色)。
*
*默认值:如果未指定-调用barChartView:barViewAtIndex:。
*
*@param barchart查看请求此信息的条形图对象。
*@param index给定条的从0开始的索引(从左到右,x轴)。
*
*@返回用于在图表中为条形图着色的颜色。
*/
-(UIColor*)条形图视图:(JBBarChartView*)条形图视图颜色用于条形图索引:(NSUInteger)索引;
/**
*在触摸事件期间覆盖在条上的选择颜色。
*颜色将自动淡入透明(垂直)。该属性显示VerticalSelection
*必须为“是”才能应用颜色。
*
*默认值:白色(褪色为透明)。
*
*@param barchart查看请求此信息的条形图对象。
*
*@返回要在每个条选择上使用的颜色。
*/
-(UIColor*)barSelectionColorForBarChartView:(JBBarChartView*)barChartView;
/**
*横条之间的水平填充。
*
*默认值:基于条形图总数和图表宽度的“最佳猜测”算法。
*
*@param barchart查看请求此信息的条形图对象。
*
*@返回每个条之间的水平宽度(以像素为单位)。
*/
-(CGFloat)barChartView的条形图填充:(JBBarChartView*)barChartView;
@结束
@接口JBBarChartView:JBChartView
//这两行有错误
@属性(非原子,弱)id数据源;
@属性(非原子,弱)id委托;
//.
/**
*触摸事件期间,垂直高光覆盖在条上。
*
*默认值:是。
*/
@属性(非原子,赋值)BOOL showsVerticalSelection;
/*
*钢筋可以(垂直)自上而下放置,而不是自下而上。
*如果此属性设置为“是”,则条形图和选择视图都将反转。
*要使反转方向生效,必须调用reloadData。
*
*默认值:否。
*/
@属性(非原子,赋值,getter=isInverted)布尔倒转;
@结束
如果我们看一下,我们可以看到它已经有了一个委托
(类型id
)和数据源
(类型id
)JBBarChartView
这里试图重新声明这些属性符合更具体的协议。我认为对于同样的问题有一个很好的答案。您可以使用显式合成或动态来修复此类警告。代码如下:
@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
@接口JBBarChartView:JBChartView
//这两行有错误
@属性(非原子,弱)id数据源;
@属性(非原子,弱)id委托;
@结束
//马克:动态
@JBBarChartView的实现
@动态数据源;
@动态委托;
@结束
//马克:显式合成
@JBBarChartView的实现
@综合数据源;
@综合代表;
@结束
查看此项以了解有关叮当声的更多信息