Archive for December, 2008


Library: iTGB 1.1

If you’re looking for a more commercial alternative to the free iPhone game programming libraries we’ve mentioned earlier, or if you’re looking to share your development environment between iPhone and desktop versions — although, we must mention, based on our experience to date that’s not the optimal development strategy! — you may be interested in Garage Game’s Torque for iPhone products, iTGB 1.1 the 2D version of which is now available for $500 (indie developers) or $1000 (commercial developers).

… The SDK features an integrated level editor, physics modeling and collision detection, particle effects features support for scripting through TorqueScript, GarageGames’ own scripting language.

Improvements to iTGB 1.1 include texture compression using iPhone-native PowerVR libraries. The update also yields performance increases of up to 300 percent thanks to code optimizations.

In related news, GarageGames notes that more than 100 companies have licensed iTGB for development of their own iPhone games….

Personally we think the Sapus Tongue project mentioned earlier looks a lot more interesting, but hey, more options are always better!

h/t: MacWorld!


Snippet: Full screen presentModalViewController

Today we have a little iPhone user interface programming problem to present to you with its not so self evident solution, courtesy of the kind assistance of one Bryan Henry on the iphonesdk list.

The scenario is, we’ve pushed a pack of controllers onto our UINavigationController as we drill down through the interface, and now we’ve reached a place where the user taps something that we want to enter a full screen display state for momentarily. Well, that’s easy enough, the naïve iPhone programmer thinks to himself, we’ll just hide the status bar then modally present a controller with a full screen view, right?

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];

FullscreenController *fullscreenController = [[FullscreenController alloc] initWithNibName:@”Fullscreen” bundle:nil];

[self.navigationController presentModalViewController:fullscreenController animated:NO];

[fullscreenController release];

Yes, he would think that. But he WOULD BE WRONG. What actually happens is that the view is presented below the empty space where the status bar used to be. Bah. Fooling with offsets in the “Fullscreen” xib file simply results in the view being clipped by that empty space. Double bah. Thankfully, a plaintive plea to the list produces in short order an explanation:
Your problem is that the UITransitionView that is used to animate in   
your modal view has clipsToBounds=YES, so any drawing that should   
happen in the rect where the status bar would be doesn’t happen since   
the UITransitionView’s bounds don’t extend there. I ran into this just   
the other day. The (somewhat hackish but completely safe) solution was   
to set clipsToBounds=NO for the UITransitionView whenever its set as   
the superview (or rather, whenever your view is added as a subview of   
the UITransitionView). 
Well, that was somewhat less than intuitive, wasn’t it now? So what you need is a patched UIView class,

@interface NoClipModalView : UIView



@implementation NoClipModalView

- (void)didMoveToSuperview

   self.superview.clipsToBounds = NO


and then in your controller, rather than having it actually load the nib, you override -loadView to have it create one of those, and then create your fullscreen views inside it.

- (void)loadView


   // instead of calling [super loadView], which doesn’t account for a hidden status bar, create an unclipped view here

   CGSize screenSize = [UIScreen mainScreen].bounds.size;

   CGRect screenBounds = CGRectMake(0, -20, screenSize.width, screenSize.height);

   NoClipModalView *sView = [[NoClipModalView alloc] initWithFrame:screenBounds]; 

   self.view = sView; 

   [sView release];

   // and then manually create the view(s) you want inside it.

   TWGestureImageView *newImageView = [[[TWGestureImageView alloc] initWithFrame:screenBounds] autorelease];

   self.imageView = newImageView;

   [self.view addSubview:self.imageView];


 And that, dear friends, is how to create a full screen modal display. Reverse it from where you created the FullscreenController up at the top with the expected

   [self.navigationController dismissModalViewControllerAnimated:NO];

   [[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];

and th-th-that’s all folks!

Code: CocoaWebResource

Here’s a possibly handy piece of code for you: Feel like making your iPhone into a web server? Or, more sensibly, sharing files on it via http? Well, here’s a little project called CocoaWebResource that sorts that out nicely!

Until now, Apple does not provide a solution for file transferring for iPhone and iPod Touch. CocoaWebResource is a lightweight http service to handle file resources for iPhone and iPod Touch. With CocoaWebResource, you can start a http server on iPhone and use a web browser to upload, download and delete files for iPhone and iPod Touch. No special client is required.

This project is based on cocoahttpserver by Deusty Designs and uses RegexKitLite by John Engelhart.

Hmmmm – mmmm – mmmm … there’s some interesting ideas that come to mind with location-aware web serving. Must think on this one further!


Code: Sapus Tongue

Quite a while back we wrote you a post on cocos2d for iPhone, an interesting-looking 2d animation framework. Well, the fellow who did that has come up with a nifty way of monetizing that; first off, wrote called Sapus Tongue, available in 99¢ full and Lite free versions so you can see for yourself how well it works in practice … and is selling off the source code for $199 or $399 with support.

Sapus Tongue v1.2rc source code:

  • Basic game scenes:
    • Intro scene
    • Menu scene
    • Instructions scene
    • HighScore scene
    • Select Character scene
    • Game + Game HUD scene
    • Credits Scene
  • Sound support that has pause/resume/play/stop
  • Local and global high score code: SQLite, NSURL and more
  • Transitions and code that prevents delays in transitions
  • Chipmunk integration: optimizations, tunning, debug mode, etc.
  • Accelerometer as input
  • UIKit controls integration: UITable, UIKeyboard, UIAlert and more
  • Code that embeds and play a video file
  • Gameplay with pause, restart options
  • Menus & buttons
  • Parallax Scrolling, Tile Map and LabelAtlas
  • Tips that prevents initial flicker from Default.png to transition
  • The sources are in objective-c and they are easy to read.

That’s actually not a bad price at all for a full working example of an iPhone game. Why, we might give ourselves that for a Christmas present just to take a look at how well this cocos2d thing works in practice!


App Store Rankings

Here’s a couple posts with hard numbers to link App Store ranks with actual numbers for you!

First up, conversions for the … well, let’s be polite, the novelty application iFart Mobile can be found here:

Date – Units/Day – Rankings
12/12 – 75 units – #70 entertainment
12/13 – 296 units – #16 entertainment
12/14 – 841 units – #76 overall, #8 entertainment
12/15 – 1510 units – #39 overall, #5 entertainment
12/16 – 1797 units – #22 overall, #3 entertainment
12/17 – 2836 units – #15 overall, #3 entertainment

Hey, even at only 99¢ apiece, that looks like a good return on investment, doesn’t it now?

For a more detailed look at budgets, sales and revenue, you can look here and find a dissection of the performance of the more intrinsically useful AppCubby applications. Selected highlights:

While I agree with the need for marketing, the only methods of marketing I’ve found to be measurably cost effective are working with the press and getting featured by Apple, both of which are essentially free, but incredibly hard to guarantee…

I’ll start with the earliest marketing attempt, a banner ad on …  Without click tracking there is no way to know exactly how many clicks turned into sales, but I doubt it was anywhere near the number needed to break even, much less turn a profit on this endeavor.

The AdMob experiment … I spent over $500 (2224 clicks) the first day and couldn’t wait to check my sales the next morning. Well, sales barely moved, and I had spent 3 times more on advertising than I saw in gross sales … After spending the last $3,000 buying ads for Gas Cubby, I still haven’t seen a pattern that would confirm AdMob to be a cost effective marketing solution for my apps. This is by no means a conclusive test of the overall effectiveness of AdMob, but the numbers are pretty telling.

I’m admittedly not an AdWords ninja, so I took a very conservative approach, bidding low on highly targeted ads. The ads have throttled up and down as cheap ad space comes and goes, but have added up to almost $600 in 4 months. Without a way to track which clicks turn into sales, it seems foolish to throw money into a black hole bound by competitive placement and fraught with click fraud.

Many developer’s have chosen to offer an “Lite” version of their app … As opposed to what most people think, this strategy doesn’t seem to be paying off for most developers.

Hmmmm. Well, if none of the conventional advertising channels work, what does? Well, it kinda boils down to making yourself worthy of attention, oddly enough:

… so far the strategy that has made the most fiscal sense is to spend money on development and hope for good placement with Apple and the press.

There you go then — your one sentence guide to how to succeed at iPhone development!


Code: OLBTwitpicEngine

Today we draw your attention to a piece of code that demonstrates uploading images from the iPhone, specifically to this thing called “Twitter” that it seems all the kids are excited about these days. It’s called OLBTwitpicEngine, and here’s how it’s described:

Today we’re releasing source code for uploading and publishing UIImages from the iPhone to Twitter, via the TwitPic web service.

OLBTwitpicEngine is a simple class that takes care of it all, including uploading the image on a separate thread to keep the UI responsive. It also posts back a message to the delegate on success, including a link to the post. The OLBTwitpicEngine class was originally developed for use in our Light Table iPhone app.

Personally, we kinda figure that this whole “Twitter” thing is very appropriately named, if you know what we mean and we think you do, but hey, if it’s your bag, there you are. And if not, hey, uploading via a web service is a handy piece of code to check out in any event!


The first 5 months

In case you missed it at the beginning of the month (yeah, yeah, we’re catching up quick as we can) there’s a fascinating update over at O’Reilly Radar on the first five months of the App Store. Definitely worth just clicking over there and reading the whole thing yourself, but here’s a couple quick highlights as of the end of November:

- About 9,800 unique applications, 22% of which are free;

- Sale prices of Top 100 apps continue to decline, currently average $2.60 and median $1.25 or so;

- Games and Entertainment continue to dominate the listings

Some excellent graphs on percentage by price point, free/paid share by category, etc. to be seen there as well, so we’ll just repeat our advice to go read the whole thing.

And hey, here’s your brain teaser for the day, since we’ve got all these cool trip pictures to share: Where was this shot taken last week? Hint: It was used as the Massassi Outpost on the fourth moon of Yavin in a little movie you might have heard of, name of Star Wars.


Gimme hint: It’s in Guatemala. You can figure it out from there, I’m sure.


Here’s a new site for you to bookmark to keep up with news of the iPhone programming world:

What is is a community based news site edited by our members. It specialises in iPhone SDK development techniques, technologies and tools including Xcode, iPhone Simulator, Instruments, Interface Builder, SQLite, OpenGL ES, Cocoa.

Individual users of the site submit and review stories, the most popular of which make it to the homepage. Users are encouraged to ‘kick’ stories that they would like to appear on the homepage. If a story receives enough kicks, it will be promoted.

So basically, we’re talking a digg clone focused on the iPhone SDK. Well hey, we can never have too many of those, can we?

And yes, it’s been quite a while since the last post, we know. We were off adding the Caymans, Honduras, Belize and Gautemala to our places visited list. Hey, we’ve got less than 600 places left to go now!

Welcome Alex Curylo!  Your MTP ranking is #450.  You have visited 158 places and have 599 remaining.

The Troll’s top trip travel tip: If you’re in the area, do not miss Stingray City off Grand Cayman. Seriously.

No, that is not an aquarium. That is the open sea. And no, they will not give you the Steve Irwin treatment unless you do something really stupid. Barring that, they’re completely blasé about being swam with, petted, and so forth. The worst they’ll do is butt you if they think you’re not being generous enough with the treats … they have a taste for calamari sashimi. Enough of a taste to put up with the tourist crowd!


PVRTC compression

Now this is interesting. A few months back I filed a Radar bug asking for documentation to be produced on the tool that creates PVRTC compressed textures for the iPhone, called — reasonably enough — texturetool. And I got a note saying that they have indeed now done that. However, the message closes with


Wait, what? Didn’t we sort that whole NDA thing out already?

Well, just to err on the side of safety, I won’t go into any detail here on my use of PVRTC textures or copy any of the information. However, if you are using OpenGL textures on the iPhone, you should probably log in and take a look at Technical Q&A QA1611 for some interesting information. I trust just naming it won’t upset the NDA police too much!