![](/img/trans.png)
[英]GLKTextureLoader fails when loading a certain texture the first time, but succeeds the second time
[英]GLKTextureLoader textureWithContentsOfFile: fails for the first time
我正在使用GLKTextureLoader
将图像纹理加载到精灵中。
当我运行下面的代码,并装载两个精灵...
NSString *pathToImage = [NSString stringWithFormat:@"%@/defaultProject/images/%@", [Util applicationDocumentsDirectory], fileName];
NSLog(@"path: %@", pathToImage);
self.textureInfo = [GLKTextureLoader textureWithContentsOfFile:pathToImage options:options error:&error];
if (self.textureInfo == nil)
{
NSLog(@"Error loading file: %@", [error localizedDescription]);
return;
}
...对于第一个图像失败,但对于第二个图像则失败。
错误是:
Error loading file: The operation couldn’t be completed. (GLKTextureLoaderErrorDomain error 12.).
有人知道这个错误是什么意思吗? 我没有找到有关代码12的任何信息。
提前致谢!
错误代码12表示根据( Apple Docs ) GLKTextureLoaderErrorDataPreprocessingFailure
我认为错误原因是文件损坏。 尝试重新保存损坏的图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.