从函数返回 CGPoints
我还有一个关于在交汇处传递 CGPoint 的问题:
(CGPoint[]) displayPoints:(CGPoint) startPoint
withEnd:(CGPoint) endPoint
withBaseRotate:(Boolean) baseRotate {
// do some stuf with four or six points
// create a array of the points and return - it
CGPoint ourPoints[] = {
CGPointMake(point1.x, point1.y),
CGPointMake(point2.x, point2.y),
CGPointMake(point3.x, point3.y),
//... some more points
} ;
return ourPoints[];
}
为什么这不起作用?
I have another question about passing CGPoint
in junctions:
(CGPoint[]) displayPoints:(CGPoint) startPoint
withEnd:(CGPoint) endPoint
withBaseRotate:(Boolean) baseRotate {
// do some stuf with four or six points
// create a array of the points and return - it
CGPoint ourPoints[] = {
CGPointMake(point1.x, point1.y),
CGPointMake(point2.x, point2.y),
CGPointMake(point3.x, point3.y),
//... some more points
} ;
return ourPoints[];
}
Why is this not working?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
必须返回一个指向它在内存中存储位置的指针
如果您查看 CFContextAddLines 的签名,您会发现这就是他们正在使用的。现在编译器会抛出一个警告,要求返回内存指针...所以我不确定这是否是首选方式,但它回答了您的问题。
Have to return a pointer to where it is stored at in memory
If you look at the signature of CFContextAddLines, you'll see that is what they're using. Now the compiler will throw a warning for returning a pointer to memory... so I'm not sure if this is the preferred way but it answers your question.