Tag ‘Xcode’

How to implement shadows with OpenGL ES on iPhone SDK — an overview

shadows-open-gl-es-iphone-ipod-touchOne of our projects currently under development is a 3D puzzle game where player will manipulate a number of cubic blocks. Those blocks can be moved above the board so to look realistic they need to cast shadows onto the board. Despite shadows are used in many 3D games and OpenGL ES does have all necessary things to implement them there is no support for shadows in API itself so the implementation is not straightforward at all. The task requires some smart coding. Let’s see how it can be done.

Continue reading

How to implement resumable file downloads on iPhone SDK

iphone_sdk_codeFile downloading is a feature used very often in various applications. You may need to get an update from the server, to provide optional resources to the user or to get a copy of a shared document — all this functionality deals with file downloads. And as long as downloads go over network they can be interrupted which is very frustrating, especially if you are downloading something big that takes a lot of time.

Modern applications can’t afford forcing users to start interrupted downloads from the beginning. In Mac OS X SDK we have a very nice NSURLDownload class that supports download resuming functionality. This class is not a part of iPhone SDK though. That’s why we have to descend one level lower and look into what HTTP protocol provides.

Continue reading

Xcode won’t recognize iPhone OS 3.0.1

Brad Midgley

If you see a message like “The version of iPhone OS on (your phone’s name) does not match any of the versions of iPhone OS supported for development with this copy of Xcode” after the 3.0.1 update, the quick fix is to run in a shell:

sudo ln -sf 3.0\ \(7A341\) /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1

And then restart Xcode and reconnect the device. A long discussion about this at technolosophy.

Continue reading

Native iPhone look in rhomobile

Brad Midgley

Getting to Railsconf 2009-81

Rhomobile provides great instant gratification in building applications. See my last article for a starter.

There are some elements you’ll miss as you start to work on the iPhone target. The back button is one and the custom tab bar is another.

The main bar can currently be customized by building rhodes from source (the way I did in the previous post). Open platform/iphone/rhorunner.xcodeproj in Xcode and double-click MainWindow.xib under Resources. This will launch it in Interface Builder.

You might wonder why the bottom bar is a toolbar and not a tab bar. Native iPhone apps typically use a tab bar that switches the view above the bar. This isn’t going to work for rhodes however–we aren’t going to change to a different view. We’ll simply tell the UIWebView to go to another part of the application. Fortunately,

Continue reading