Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/122.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 glkView和update方法之间有什么区别?_Ios_Objective C_Glkit - Fatal编程技术网

Ios glkView和update方法之间有什么区别?

Ios glkView和update方法之间有什么区别?,ios,objective-c,glkit,Ios,Objective C,Glkit,当子类化GLKViewController时,它有两种方法: -(无效)更新 和-(void)glkView:(glkView*)view drawInRect:(CGRect)rect 这两种方法似乎都在每一帧中调用。文件内容如下: 作为在委托中实现glkViewControllerUpdate:方法的替代方法,您的子类可以提供更新方法。该方法必须具有以下签名: -(作废)更新 我应该在我的代码中覆盖哪一个,其中哪一个应该包含draw调用?此线程回答以下问题: 引述: 关于update()

当子类化
GLKViewController
时,它有两种方法:

  • -(无效)更新
  • -(void)glkView:(glkView*)view drawInRect:(CGRect)rect
这两种方法似乎都在每一帧中调用。文件内容如下:

作为在委托中实现
glkViewControllerUpdate:
方法的替代方法,您的子类可以提供更新方法。该方法必须具有以下签名:

-(作废)更新


我应该在我的代码中覆盖哪一个,其中哪一个应该包含draw调用?

此线程回答以下问题:

引述:

关于update(),视图控制器调用其委托的glkViewControllerUpdate:方法。您的代理应该更新不涉及将结果呈现到屏幕的帧数据

关于drawInRect:GLKView对象使其OpenGL ES上下文成为当前上下文,并将其帧缓冲区绑定为OpenGL ES渲染命令的目标。然后,委托方法应该绘制视图的内容