0
我正在使用GLKTextureLoader
将图像纹理加载到精灵中。GLKTextureLoader textureWithContentsOfFile:第一次失败
当我运行下面的代码或装载两个精灵......
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的任何信息。
在此先感谢!
你说得对。当我更改文件并保持文件名相等时,它就可以工作。但是我可以在预览中打开文件?所以它绝对不是腐败?!唯一的区别在于文件大小。 – Chris 2012-07-21 10:05:48
文件可以正常使用,但由于某种原因无法处理。重新保存相同的文件应该可以解决您的问题。 – 2012-07-21 20:52:28