Cocoa Design Patterns
Learning OpenGL ES for iOS
Buy at Amazon Now
  • Cocoa Design Patterns
    Cocoa Design Patterns
    by Erik M. Buck, Donald A. Yacktman
  • Learning OpenGL ES for iOS: A Hands-on Guide to Modern 3D Graphics Programming
    Learning OpenGL ES for iOS: A Hands-on Guide to Modern 3D Graphics Programming
    by Erik M. Buck
« Exploring GLKit for Mac OS X 10.8 Mountain Lion | Main | Check out "Introducing OS X Mountain Lion: What's New and What's Changed for Lion Users" »

"Learning OpenGL ES for iOS" has shipped

Safari Rough Cut of "Learning OpenGL ES for iOS" has been replaced with the actual digital version. The book book is on sale at Siggraph next week. Amazon pre-orders should be fulfilled within the week as well.

Reader Comments (13)


First, I have been longing for your book since last October's Voices That Matter presentation and am glad it is out. Thank you.

When I opened ColladaViewer in Xcode 4.5 (4G182) and tried to build, I got an error in COLLADAGeometryInfo.m,

/Users/jdhouse4/Downloads/Examples/ch07_EXAMPLES/COLLADAViewer/COLLADAViewer/COLLADAGeometryInfo.m:34:1: Type of property 'NSUInteger' (aka 'unsigned long') in continuation class does not match property type in primary class

that pointed to the class extension declaration,

@property (nonatomic, readwrite, assign) NSUInteger

So, I went into the interface file and saw that nextAvalableIndex was declared as,

@property (nonatomic, readonly, assign) GLushort

and I changed it to be declared as,

@property (nonatomic, readonly, assign) NSUInteger

Am I missing anything?
September 24, 2012 | Unregistered CommenterJim Hillhouse
I hope the book proves to be helpful for you.

You aren't missing anything. There is a mismatch between GLushort and NSUInteger. It has been in the sample code for more than a year. I'm in the process of making several corrections and improvements to COLLADAViewer. Some of the methods it uses are now deprecated in OS X 10.8. Some of the application's behavior needs to be improved as well. For example, it suffers and assertion failure if the COLLADA file loaded contains more than 56535 vertices. The application should probably just warn the user instead. I am also improving the use and storage of textures.

Thank you for the feedback. Don't hesitate to ask questions.
September 24, 2012 | Registered CommenterErik Buck
I bought your book, and started with the very first example (chapterb2.1)
Tried to run it and it didn't work.
I then tried to run it with your downloaded code but had the same error. ([GLKViewController loadView] loaded the "2-view-3" nib but didn't get a GLKView)

Not a good start. Why do I get that error?
November 18, 2012 | Unregistered CommenterYvo

I am mystified why you receive errors building the downloaded projects. I have certainly never experienced such problems. I would expect to have received hundreds of complaints by now if others were experiencing that problem.

What versions of iOS, OS X, and Xcode are you using?
November 18, 2012 | Registered CommenterErik Buck
I'm using Mac OS X 10.8.2 and Xcode Version 4.5.2 (4G2008a)
I usually do the example myself using a different name for the exercise. When that didn't work, I just ran your OpenGLES_Ch2_1 project but I got the same error (see log below)
What's weird is that I ran your OpenGLES_Ch2_2 exercise and that worked fine.
I'm at a loss why the first one doesn't run.

The error log says "could not find 'MainStoryboard_iPad" in bundle, but I checked and it is in the package in the en.lproj folder.

I will redo the exercise, from scratch, this time using your downloaded files to ensure I don't miss anything

Here's my error log:
2012-11-19 09:52:27.104 OpenGLES_Ch2_1[42296:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard_iPad' in bundle NSBundle </Users/yvo/Library/Application Support/iPhone Simulator/6.0/Applications/13950E36-0DDC-4313-9C1D-35AEE733A5C0/> (loaded)'
*** First throw call stack:
(0x1ed6012 0x1313e7e 0x45bed6 0x14d64 0x15002 0x13ed6 0x25315 0x2624b 0x17cf8 0x1e31df9 0x1e31ad0 0x1e4bbf5 0x1e4b962 0x1e7cbb6 0x1e7bf44 0x1e7be1b 0x137da 0x1565c 0x252d 0x2455)
libc++abi.dylib: terminate called throwing an exception
November 18, 2012 | Unregistered CommenterYvo
I fixed it!!

After I entered the code in my own exercise (following your book) I went through all the files comparing them with yours.
I finally hit a difference in the "MainStoryBoard_iPhone": when I clicked the "View" I noticed that on the right side, under "Custom Class" I had "UIView" whereas your code has GLKView.
I changed it and it finally worked.
Now the funny part is that your code doesn't run but mine does.

Oh, and by the way, in my original exercise I had not included the -(void) ViewDidUnload method (because XCODE gave me a warning that it was not needed) I eventually added it.
November 18, 2012 | Unregistered CommenterYvo
Thanks Yvo! I had the same problem and that fixed it :)
November 28, 2012 | Unregistered CommenterFuzums
Thanks Yvo.
I crashed exactly the same problem
and I fixed it because of your mention.
December 7, 2012 | Unregistered CommentersD
thanks Yvo, I was having the same issue
December 23, 2012 | Unregistered CommenterCarlo
Hi Eric,
great book thanks! Enjoying it so far. Just wondering, is there a forum to share questions with other readers?

I've posted a question on Stackoverflow but not much luck so far.

Would be great to collaborate with other readers.

Best wishes,
January 22, 2013 | Unregistered CommenterMax
There have been some discussion back and forth at the book's web site (here) even though that's suboptimal.

Twitter is an option for some people.

There are some active user groups that discuss the book. If you like, I'll ask a user group to add you to their list of subscribers. I can't commit them, but the groups seem very welcoming.
January 22, 2013 | Registered CommenterErik Buck
Hi Eric, Great book!! However I am finding some issues with models where the depth buffer seems to break. On the boat model in Ch8_1 or Ch8_2 some pieces of the model are always in front (deck hatch etc) and one piece at the top of the mast is always behind. I have had some similiar errors when using GLKit on my own models. I am using XCode 4.5.2 on OSX 10.8.3.

Any ideas on how to fix such problems? Regards Graham
June 10, 2013 | Unregistered CommenterGraham Randall
Hi Erik,

your book has been fantastic Ive learnt so much, there is one puzzle I am having though...

In the particle example in OpenGLES_Ch8_3 if the view isnt the initial view controller it doesnt work.

Is there a fix for this?
June 28, 2013 | Unregistered CommenterIan Clay

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
All HTML will be escaped. Hyperlinks will be created for URLs automatically.