gpt4 book ai didi

objective-c - CGRect 和 NSRect 之间有什么区别吗?

转载 作者:太空狗 更新时间:2023-10-30 03:12:01 24 4
gpt4 key购买 nike

CGRectNSRect 有区别吗?特别是,我想知道原点的位置。有什么我需要了解的重要差异吗?

最佳答案

它们是一样的。 This link有更多信息。复制到此处以供快速引用:

CGRect is the CoreGraphics equivalent of NSRect.

They are deliberately made to have the same layout in memory. As such, it is allowed to convert an NSRect to a CGRect by doing this:

CGRect cgrect = *(CGRect *)&nsrect;

CoreGraphics also provides a CGRectMake() function which works the same as NSMakeRect() (note the reversal of verb and object in the names) except it returns a CGRect.

关于objective-c - CGRect 和 NSRect 之间有什么区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2151027/

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