作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我想得到这个结构:
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/
我是一名优秀的程序员,十分优秀!