使用“GetTiming()”的错误和警告CAKeyframeAnimation 的函数
我遇到了有关“GetTiming()”函数使用的一个错误和一个警告。我的冷如下:
[values addObject:[NSNumber numberWithFloat:25.0]];
[timings addObject:GetTiming(kCAMediaTimingFunctionEaseIn)];
[keytimes addObject:[NSNumber numberWithFloat:0.0]];
我正在导入以下内容:
#import <QuartzCore/CAAnimation.h>
#import <QuartzCore/CAMediaTimingFunction.h>
我认为错误是由于我正在使用 ARC,并说:
implicit conversion of 'int' to 'id' is disallowed with ARC.
我尝试在相关文件中禁用 ARC,但错误仍然存在。
关于警告,它说:
implicit declaration of function 'GetTiming' is invalid in C99
任何人对如何解决这些问题有任何想法吗? 多谢!
I'm having one error and one warning concerning the usage of the 'GetTiming()' function. My colde is as follows:
[values addObject:[NSNumber numberWithFloat:25.0]];
[timings addObject:GetTiming(kCAMediaTimingFunctionEaseIn)];
[keytimes addObject:[NSNumber numberWithFloat:0.0]];
I am importing the following:
#import <QuartzCore/CAAnimation.h>
#import <QuartzCore/CAMediaTimingFunction.h>
The error I suppose is due to the fact that I'm using ARC, and says:
implicit conversion of 'int' to 'id' is disallowed with ARC.
I tried to disable ARC in the concerning file but the error persists.
About the warning, it says:
implicit declaration of function 'GetTiming' is invalid in C99
Any one have any ideas on how can I fix these issues?
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先确保 GetTiming 函数存在(包括正确的标头)。现在,如果
GetTiming
返回一个int
问题是您无法将原始值添加到数组中。您需要将返回的值包装在NSNumber
中。编辑:
您缺少
JackController.m
中声明的函数。为了简单起见,不要使用该函数,只需直接创建它。
First make sure that the
GetTiming
function exists (include the right header). Now ifGetTiming
returns anint
the problem is you can not add a primitive value to an array. You need to wrap the value returned in anNSNumber
.Edit:
You are missing the function that was declared in
JackController.m
.For simplicity do not use that function, just create it directly.