Archive for September, 2009
Fading an Image into Another
My Pollen project required that I be able to have an image, and fade it into another image. Other projects since then have also had similar requirements. The effect is very nice, and the great thing is that the code is really quite simple. Just have two images, and do an animation from one to the other. I like have one image always being the active one (when not animating), so that’s how I structured the code below. I assume you have two UIImageView’s set up named mFrontView and mBackView.
UIImage *oldImg = mFrontView.image;
if ( newImg != oldImg )
{
[mBackView setImage:mFrontView.image];
mFrontView.alpha = 0;
mBackView.alpha = 1;
[mFrontView setImage:newImg];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
mFrontView.alpha = 1;
mBackView.alpha = 0;
[UIView commitAnimations];
}
Pricing Apps: More is Better
AppsFire recently did some work trying to determine which apps on Apple’s AppStore are the most profitable? Surprisingly, it’s not the cheapo $0.99 apps that are making all the money (through volume, everyone assumes). It’s the high quality apps that charge more:
This list computed using the simple UNITS SOLD x UNIT PRICE formula may yield a few ‘outliers’ and the science is not perfect [...]. In any case, the findings are staggering: the money makers are real apps, all very solid, all but one with a price tag greater or equal to $2.99, but often well above $10.00. The top app costs $899 and the second one $99. These apps solve real issues, and are made by solid developers. And guess what, they are deriving serious revenues too!
The key takeaway here is for the developers and businesses that are hard at work developing apps: if your app brings something real to the table, be it a game or a utility similar to the ones you find on the left, then price it accordingly. The price is right when there is a salary at the end of the month. Don’t succomb to the temptation of the $0.99 app, it’s a lure and only serves to feed the get-rich-quick fairy tales that even kids would find hard to believe.
The only app I ever put up on the AppStore is Chewy Xbox, and it was free because Microsoft said it had to be (because it accesses their Xbox Live information). And I’ll be re-releasing the app soon, with some improvements. Most of my work was done for other people, and I now have a full time job doing iPhone work. [Update: I won't be releasing the app after all. The source of Xbox Live data I use is no longer reliable, and I can't find a replacement. Microsoft has ignored me.]
So I can’t say from experience that apps that sell for more than $0.99 do better than the 99 cent apps. But if I ever do end up selling an app on the AppStore, I plan to sell if for more than 99 cents. Because I think all the time and effort I’d put into an app is worth at least the price of a coffee.
New Website
I bought a theme for use here, just because I think it was about time I made this place look a little more professional.
You can see some featured apps and a featured client on the main page, and soon I’ll be creating a portfolio pages that showcases all of the iPhone apps that I’ve worked on.
But for now, just relax and enjoy the new site. I think it looks pretty sharp.
Featured App: Pollen
The Pollen app was the first app I did for a client who knew exactly what they wanted down to the pixel. Their wireframes were so detailed, it looks like they looked into the future, took screenshots of the app, and put the screenshots into the wireframe.
They specified fonts, image sizes, backgrounds, timings (for the progress indicator), and everything else down to the smallest detail.
This made estimating the app a lot easier. It also made actually creating the app a lot easier too. There was no second-guessing the client and then having them come back with changes.
It was really nice.
Here you can see the splash screen. The problem was that the splash screen wasn’t showing for long enough. The client actually wanted people to look at the splash screen. So they requested that I make the splash sequence longer, and that I add the progress indicator.
Here you see the first image after the app is done loading. It’s a map of the country, showing pollen concentrations. I download the latest image from the internet and fade it into place over the last image downloaded. I think it’s a pretty cool effect, and it wasn’t too hard to do.
Here is the video list. It changes depending on what’s available on the client’s site. So more pollen report videos become available over time.
Last up, this is the info page with information about the app and the pollen website and service. The link brings you to the website, prompting you first.
Featured Client: Aurnhammer LLC

Aurnhammer LLC, based in New York city, was one of my first clients as a freelance iPhone developer. I started work for them back in December of 2008, working on the P!nk app. I also worked on The Fray, the Stanley Level app, a real estate app, a vodka app, and a casino app.
I learned a lot about how to manage the client relationships. I do all my work from my home office in Ottawa, so we needed to use email, phone, skype, and other web based tools in order to communicate. I learned that having good bug tracking and project management systems is a must. I now use unfuddle with my new clients if they don’t have a system in place.
Featured App: Senses

Senses was one of the first apps that I created as a freelancer. It was definitely a learning experience, but I enjoyed it immensely. Like the P!nk and The Fray apps, I had to use audio. This time I had to play audio for the right ear and the left ear and to change the volume according to what loudness is being tested. I also learned more about both user and client interaction. They client was based in Australia, so often we would have IM chats in the morning for me, but late at night for them.
Fixing Broken Pipes
There’s nothing like the simulator for putting your app together quickly. It’s better than debugging on the device for one main reason: it’s fast! Starting up the app is fast. Debugging the app is fast. Everything is fast.
But sometimes you just need to slow down. By using the device. Of course, I was testing on the device today and made a critical error.
I couldn’t figure out what was wrong. I was getting error messages in the debugger console like this:
putpkt: write failed: Broken pipe
Or this:
mem 0×1000 0x3fffffff cache
mem 0×40000000 0xffffffff none
mem 0×00000000 0x0fff none
Or even like this:
Sent: [1251990710.449:32] +
Sent: [1251990710.449:32] Hc-1
Recvd: [1251990710.454:32] OK
Sent: [1251990710.455:32] qC
Recvd: [1251990710.460:32] QC0
Sent: [1251990710.460:32] qStepPacketSupported
Recvd: [1251990710.463:32] OK
Sent: [1251990710.478:49] QEnvironment:SHELL=/bin/bash
Recvd: [1251990710.481:49] OK
Sent: [1251990710.481:49] QEnvironment:TMPDIR=/var/folders/UF/UFCJNauIGPu+F7L7bsqhZU+++TI/-Tmp-/
Recvd: [1251990710.485:49] OK
Sent: [1251990710.485:49] QEnvironment:Apple_PubSub_Socket_Render=/tmp/launch-o19tpZ/Render
Recvd: [1251990710.488:49] OK
etc…..
It was quite frustrating.
So I looked around on the forums, and there were several questions about these errors, many of which went unanswered. (Forums can only get you so far sometimes.) But eventually I found the answer: you can’t debug your program if you’re using an ad hoc profile.
So I used the appropriate profile, and now I debug to my heart’s content. iPhone development seems to be straining with this kinds of gotchas. I just hope I remember this solution next time I find this problem. Writing it down will help, I hope!
Images in a Scroll View
I know that when I was a beginning iPhone developer doing things that seem so simple now weren’t so simple back then. Just because I didn’t know any better and was unaware of the tools and API’s available to me.
One thing that I’ve been doing a lot recently is putting several images in a UIScrollView, so I thought I’d post the barebones version of the code here in case anyone finds it useful. Hopefully I’ll be able to add more snippets in the future.
#define IMAGE_HEIGHT 416
- (void)viewDidLoad
{
[super viewDidLoad];
NSArray *photos = nil; // TODO – fill with your photos
// note that the view contains a UIScrollView in aScrollView
int i=0;
for ( NSString *image in photos )
{
UIImage *image = [UIImage imageNamed:[photos objectAtIndex:i]];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.clipsToBounds = YES;
imageView.frame = CGRectMake( IMAGE_WIDTH * i++, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
[aScrollView addSubview:imageView];
[imageView release];
}
aScrollView.contentSize = CGSizeMake(IMAGE_WIDTH*i, IMAGE_HEIGHT);
aScrollView.delegate = self;
}