gpt4 book ai didi

objective-c - 如何在 Objective-C 中形成 CGPoint 数组?

转载 作者:太空狗 更新时间:2023-10-30 03:09:40 25 4
gpt4 key购买 nike

我想得到这个结构:

CGPoint addLines1[] =
{
CGPointMake(30.0, 150.0),
CGPointMake(41.67, 145.19),
CGPointMake(53.33, 103.25),
CGPointMake(65.0, 131.67),
CGPointMake(76.67, 106.11),
CGPointMake(88.33, 110.20),
CGPointMake(100.0, 111.54),
CGPointMake(111.67, 112.13),
CGPointMake(123.33, 115.66),
CGPointMake(135.0, 123.7),
CGPointMake(146.67, 125.53),
CGPointMake(158.33, 115.1),
CGPointMake(170.0, 69.38),
CGPointMake(181.67, 112.47),
CGPointMake(193.33, 65.1),
CGPointMake(205.0, 103.33),
CGPointMake(216.67, 92.6),
CGPointMake(228.33, 54.76),
CGPointMake(240.0, 79.66),
CGPointMake(251.67, 53.81),
CGPointMake(263.33, 56.81),
CGPointMake(275.0, 88.19),
CGPointMake(286.67, 74.81),
CGPointMake(298.33, 28.1),
CGPointMake(310, 20.0),
};

为了做一些计算和绘制数据。

我有 CGPoint *lines = appDelegate.averageResponseTimePoints;

如何从 *lines 生成数组 addLines[]

最佳答案

对于 iOS:

创建数组:

NSArray *myCGPointArray = @[[NSValue valueWithCGPoint:CGPointMake(30.0, 150.0)],[NSValue valueWithCGPoint:CGPointMake(41.67, 145.19)]];

获取第一个 CGPoint 对象:

CGPoint myPoint = [myCGPointArray[0] CGPointValue];

关于objective-c - 如何在 Objective-C 中形成 CGPoint 数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/943945/

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