Converting a CGPoint to NSValue

后端 未结 7 1895
猫巷女王i
猫巷女王i 2020-12-17 09:42

In CABasicAnimation.fromValue I want to convert a CGPoint to a \"class\" so I used NSValue valueWithPoint but in device m

7条回答
  •  天涯浪人
    2020-12-17 10:25

    &(cgpoint) -> get a reference (address) to cgpoint (NSPoint *)&(cgpoint) -> casts that reference to an NSPoint pointer *(NSPoint )(cgpoint) -> dereferences that NSPoint pointer to return an NSPoint to make the return type happy

提交回复
热议问题