Could not instantiate class named GLKView

痴心易碎 提交于 2019-12-13 14:08:02

问题


I got this exception:

2014-02-19 19:08:34.590 MyApp[42353:70b] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named GLKView'

It is because I tried to add a GL view to my xib file this way:

What I want to achieve is to draw gradient background beneath the View (the one with Label 'City')

It is probably a commonly-seen exception because any more experienced iOS developers can tell I have no clue what I am doing.

My Questions:

  1. Why this error message?
  2. Is it possible to add a GLKit View?
  3. What is a better way to add gradient background?

回答1:


You probably simply just need to add the "GLKit" framework to your project.

It's as simple as dragging the framework from the SDK folder into the "Frameworks" section of your project:




回答2:


You need to add the GLKit Framework to your project.




回答3:


To solve this problem follow the steps

  1. In Project Navigator, click on Project Name ie. the first file.
  2. In TARGETS, click on Project File Name.
  3. Then click on Build Phases.
  4. Open Link Binary with Libraries.
  5. Click on "+" button at the bottom.
  6. A popup will appear, in that scroll down and select GLKit.framework and Add.

Note: if you Added any wrong framework just click on that framework and click on "-" button



来源:https://stackoverflow.com/questions/21891290/could-not-instantiate-class-named-glkview

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!