ASDefaultPlaybackButton 参数类型兼容问题,运行报错

+ (void)drawRect:(CGRect)bounds withParameters:(id<NSObject>)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing

{

  ASDefaultPlaybackButtonType buttonType = (ASDefaultPlaybackButtonType)[parameters[@"buttonType"] intValue];

  UIColor *color = parameters[@"color"];
 
parameters 类型为ID类型,取值的时候是按nsdictionary类型使用,运行报错,有人和我一样的问题吗?
共2个回复

xiaobao

2018-05-30 14:59

是的,已经修改了,确实去你所描述的~谢谢

KevinGong

2018-05-30 15:04

点个最佳回复呀 亲

KevinGong

2018-05-30 14:47

ASDefaultPlaybackButton 你这是哪里的代码? 看样子是用了AsyncDisplayKit?   我看到官方最新的代码是这样的   [code]+ (void)drawRect:(CGRect)bounds withParameters:(NSDictionary *)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing { ASDefaultPlaybackButtonType buttonType = (ASDefaultPlaybackButtonType)[parameters[@"buttonType"] intValue]; UIColor *color = parameters[@"color"]; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); UIBezierPath* bezierPath = [UIBezierPath bezierPath]; if (buttonType == ASDefaultPlaybackButtonTypePlay) { [bezierPath moveToPoint: CGPointMake(0, 0)]; [bezierPath addLineToPoint: CGPointMake(0, bounds.size.height)]; [bezierPath addLineToPoint: CGPointMake(bounds.size.width, bounds.size.height/2)]; [bezierPath addLineToPoint: CGPointMake(0, 0)]; [bezierPath closePath]; } else if (buttonType == ASDefaultPlaybackButtonTypePause) { CGFloat pauseSingleLineWidth = bounds.size.width / 3.0; [bezierPath moveToPoint: CGPointMake(0, bounds.size.height)]; [bezierPath addLineToPoint: CGPointMake(pauseSingleLineWidth, bounds.size.height)]; [bezierPath addLineToPoint: CGPointMake(pauseSingleLineWidth, 0)]; [bezierPath addLineToPoint: CGPointMake(0, 0)]; [bezierPath addLineToPoint: CGPointMake(0, bounds.size.height)]; [bezierPath closePath]; [bezierPath moveToPoint: CGPointMake(pauseSingleLineWidth * 2, 0)]; [bezierPath addLineToPoint: CGPointMake(pauseSingleLineWidth * 2, bounds.size.height)]; [bezierPath addLineToPoint: CGPointMake(bounds.size.width, bounds.size.height)]; [bezierPath addLineToPoint: CGPointMake(bounds.size.width, 0)]; [bezierPath addLineToPoint: CGPointMake(pauseSingleLineWidth * 2, 0)]; [bezierPath closePath]; } [color setFill]; [bezierPath fill]; CGContextRestoreGState(context); }[/code]
点击此处继续提问与开发者们互动

申请试用

提交后工作人员会尽快与您联系进行功能演示
技术咨询已转移到管理后台,请先登录

即时通讯云使用者请在应用详情页面咨询
客服云使用者请进入管理员模式咨询

×

在线咨询

电话咨询

技术咨询

免费试用