我已将5.0版本的Xcode版本升级到5.1 & GPUImage Library中出现错误 GPUImageVideoCamera.m:301:54:隐式转换失去整数精度: 'NSInteger的'(亦称 '长'),以 'int32_t'(又名 'INT')值转换问题:隐式转换失去整数精度:'NSInteger'(又名'long')为'int32_t'(又名'int')
在关于这条线之下函数“connection.videoMaxFrameDuration = CMTimeMake (1,_frameRate);“错误正在发生。
- (void)setFrameRate:(NSInteger)frameRate;
{
_frameRate = frameRate;
if (_frameRate > 0)
{
for (AVCaptureConnection *connection in videoOutput.connections)
{
if ([connection respondsToSelector:@selector(setVideoMinFrameDuration:)])
connection.videoMinFrameDuration = CMTimeMake(1, _frameRate);
if ([connection respondsToSelector:@selector(setVideoMaxFrameDuration:)])
connection.videoMaxFrameDuration = CMTimeMake(1, _frameRate);
}
}
else
{
for (AVCaptureConnection *connection in videoOutput.connections)
{
if ([connection respondsToSelector:@selector(setVideoMinFrameDuration:)])
connection.videoMinFrameDuration = kCMTimeInvalid;
// This sets videoMinFrameDuration back to default
if ([connection respondsToSelector:@selector(setVideoMaxFrameDuration:)])
connection.videoMaxFrameDuration = kCMTimeInvalid;
// This sets videoMaxFrameDuration back to default
}
}
}
在Xcode 5.1中,默认情况下启用了64位体系结构。这不应该是一个错误,而只是一个警告。要摆脱警告,您可以添加显式强制转换或更新库。 – carloabelli
Xcode将其视为错误 –
@DattatrayDeokar:也许您已将生成设置“将警告视为错误”设置为YES。 - 如上面的评论所述,只需添加一个明确的强制转换,或将_frameRate的类型从NSInteger更改为int。 –