Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
loadTexture上的Vuforia 6.0.12 iOS崩溃_Ios_Swift_Crash_Objective C++_Vuforia - Fatal编程技术网

loadTexture上的Vuforia 6.0.12 iOS崩溃

loadTexture上的Vuforia 6.0.12 iOS崩溃,ios,swift,crash,objective-c++,vuforia,Ios,Swift,Crash,Objective C++,Vuforia,我正在为一位客户更新一个应用程序,他们坚持要我们继续支持FrameMarkers。因此,整个项目都已更新,但Vuforia sdk必须保持在6.0.112版本。除了Vuforia视图控制器是Objective-C++之外,所有项目文件现在都在Swift 3中。framemark检测工作正常,我可以创建一个3d对象,但当我加载3d对象的纹理时,应用程序崩溃。没有错误,只是崩溃了。尝试了一系列不同的方法来加载图像,但这并不重要。尝试使用不同的纹理以及jpg、png、2的幂和非2的幂 以前有人经历过吗

我正在为一位客户更新一个应用程序,他们坚持要我们继续支持FrameMarkers。因此,整个项目都已更新,但Vuforia sdk必须保持在6.0.112版本。除了Vuforia视图控制器是Objective-C++之外,所有项目文件现在都在Swift 3中。framemark检测工作正常,我可以创建一个3d对象,但当我加载3d对象的纹理时,应用程序崩溃。没有错误,只是崩溃了。尝试了一系列不同的方法来加载图像,但这并不重要。尝试使用不同的纹理以及jpg、png、2的幂和非2的幂

以前有人经历过吗?或者是否有人拥有Vuforia 6.0.112的Swift版本

这是它崩溃的原因:

CFRelease(图像数据)

以下是调试窗口中变量的值:

非常感谢您的帮助

提前谢谢

干杯


David

OpenGL的
copyImageDataForOpenGL
内部的
imageData发生了什么?也许它被释放了,而你又试图再次释放?
- (BOOL)loadImage:(NSString*)filename {

BOOL ret = NO;   

// Build the full path of the image file
NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
NSString* fullPath = [resourcePath stringByAppendingPathComponent:filename];

// Create a UIImage with the contents of the file
UIImage* uiImage = [UIImage imageWithContentsOfFile:fullPath];   

if (uiImage) {
    // Get the inner CGImage from the UIImage wrapper
    CGImageRef cgImage = uiImage.CGImage;       

    // Get the image size
    width = (int)CGImageGetWidth(cgImage);
    height = (int)CGImageGetHeight(cgImage);       

    // Record the number of channels
    channels = (int)CGImageGetBitsPerPixel(cgImage)/CGImageGetBitsPerComponent(cgImage);       

    // Generate a CFData object from the CGImage object (a CFData object represents an area of memory)
    CFDataRef imageData = CGDataProviderCopyData(CGImageGetDataProvider(cgImage));       

    // Copy the image data for use by Open GL
    ret = [self copyImageDataForOpenGL: imageData];
    CFRelease(imageData); // the crash happens here
} 
return ret; 
}