打电话的时候
setLineDash:(nullable const CGFloat *) count:(NSInteger) phase:(CGFloat)
通过将@[@1.0,@2.0] 传递为 (nullable const CGFloat *) 的方法
UIBezierPath *path = [self drawLine:start ended:ended];
[path setLineDash:@[@1.0, @2.0] count:2 phase:0.0];
我一直收到这个错误;
Implicit conversion of an Objective-C pointer to 'const CGFloat * _Nullable' (aka 'const double *') is disallowed with ARC
有什么建议吗?在此处传递的正确参数是什么。
表示赞赏。
最佳答案
试试这个
CGFloat dash_pattern[]={1.0,2.0};
[path setLineDash:dash_pattern count:2 phase:0.0];
关于ios objective-c 常量 CGFloat *,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55017582/