//create timing function
CAMediaTimingFunction *function = [CAMediaTimingFunction functionWithControlPoints:1 :0 :0.75 :1];
我得到的controlPoint值似乎是错误的:
CGPoint controlPoint1, controlPoint2;
[function getControlPointAtIndex:1 values:(float *)&controlPoint1];
[function getControlPointAtIndex:2 values:(float *)&controlPoint2];
The controlPoint value that I get seems to be wrong:
controlPoint1 CGPoint (x = 5.2635442471208903E-315, y = 4.9406564584124654E-324)
controlPoint2 CGPoint (x = 0.0078125018408172764, y = 2.8421186829703262E-314)
但是,如果我使用float数组作为参数的类型values,我得到controlPoint的正确值:
float c1p[2], c2p[2];
[function getControlPointAtIndex:1 values:c1p];
[function getControlPointAtIndex:2 values:c2p];
The values are:
controlPoint1 CGPoint (x = 1, y = 0)
controlPoint2 CGPoint (x = 0.75, y = 1)
32位设备可以使用第一种方法 但是在64位设备就行不通了