Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在CGPointMake让我失望之后,我发现我们可以CGPoint像这样初始化一个静态常量:
CGPointMake
CGPoint
static const CGPoint p = { 0.f, 0.f };
它有效,但大括号符号实际上在做什么?
CGPoint 是一个结构:
struct CGPoint { CGFloat x; CGFloat y; };
这是在 C 中初始化结构的有效方法。请参阅C/C++ 编程语言的结构初始化?.