gpt4 book ai didi

ios objective-c 常量 CGFloat *

转载 作者:行者123 更新时间:2023-11-29 11:29:26 26 4
gpt4 key购买 nike

打电话的时候

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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com