[英]GLKTextureLoader textureWithContentsOfFile: fails for the first time
I am using GLKTextureLoader
to load image textures into a sprite. 我正在使用
GLKTextureLoader
将图像纹理加载到精灵中。
When I run the following code and load two sprites... 当我运行下面的代码,并装载两个精灵...
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;
}
... it fails for the first image but not for the second. ...对于第一个图像失败,但对于第二个图像则失败。
The error is: 错误是:
Error loading file: The operation couldn’t be completed. (GLKTextureLoaderErrorDomain error 12.).
Does anyone know what this error means? 有人知道这个错误是什么意思吗? I haven't found any information on code 12.
我没有找到有关代码12的任何信息。
Thanks in advance! 提前致谢!
Error code 12 means GLKTextureLoaderErrorDataPreprocessingFailure
as per ( Apple Docs ) 错误代码12表示根据( Apple Docs )
GLKTextureLoaderErrorDataPreprocessingFailure
I think cause of error is a file corruption. 我认为错误原因是文件损坏。 Try to re-save your corrupted image.
尝试重新保存损坏的图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.