Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.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
Ios GLKTextureLoader不加载任何内容,没有错误_Ios_Objective C_Opengl Es 2.0_Glkit - Fatal编程技术网

Ios GLKTextureLoader不加载任何内容,没有错误

Ios GLKTextureLoader不加载任何内容,没有错误,ios,objective-c,opengl-es-2.0,glkit,Ios,Objective C,Opengl Es 2.0,Glkit,此代码记录UIImage具有宽度,但加载的纹理具有0宽度: NSDictionary * options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], GLKTextureLoaderOriginBottomLeft,

此代码记录UIImage具有宽度,但加载的纹理具有0宽度:

       NSDictionary * options = [NSDictionary dictionaryWithObjectsAndKeys:
                                  [NSNumber numberWithBool:YES],
                                  GLKTextureLoaderOriginBottomLeft,
                                  nil];

        NSError * error;

        UIImage * iu = [UIImage imageNamed:fileName];
        CGImageRef cg=iu.CGImage;

        NSLog(@"image size width: %f", iu.size.width);

        self.textureInfo= [GLKTextureLoader textureWithCGImage:cg options:options error:&error];
        if (self.textureInfo == nil) {
            NSLog(@"Error loading file: %@", [error localizedDescription]);
            return nil;
        }            

        NSLog(@"texture width: %f", self.textureInfo.width);

如果最后一行日志显示
0
我做错了什么?没有记录错误。

问题在于记录,而不是纹理加载。它是一个
int


NSLog(@“纹理宽度:%i”,self.textureInfo.width)

问题在于日志记录,而不是纹理加载。它是一个
int

NSLog(@“纹理宽度:%i”,self.textureInfo.width)