iOS App Postmortems – Feeling Blue?

Well, it took a little longer than expected, but March April’s app – Feeling Blue?– is now available on the App Store, and that means it’s time for a postmortem!

Development Time:

  • ~10h or so, over a period of about 5 weeks (this included some vacation time and a few other things, hence the delay).

Review Time (time spent in the iOS app submission queue):

  • 7 days

New technologies I learned and used:

  • I think the only new things I used were UIView animations and transparencies

Challenges:

  • The primary challenge this time was figuring out which pictures from my gigantic photo collection to use!
  • Figuring out how to get UIViews to fade in properly was a pain
  • As always, UI design is somewhat of a challenge.

Future plans: I doubt the app will get very many new features, as it already does everything it needs to, but I will likely add more pictures and quips to it.

As always, please let me know if you have any feature requests or ideas!

iOS Quick Tips – ‘A signed resource has been added, modified, or deleted’

While trying to run my latest app on my device, I kept encountering a very strange error. Xcode would pop up with a message box saying

‘A signed resource has been added, modified, or deleted’

Huh? What? In typical Xcode fashion, the error message doesn’t actually tell you anything about what’s wrong or how to fix it. It turns out that the problem was caused by having special character in the product name – in my case, a ?. Removing the ? from the product name fixed the problem. But I really wanted that question mark; the app wouldn’t be the same without it! Not to worry, because you can set the bundle name (the name that gets shown on your device’s home screen) independently of the product name, and the bundle name can contain special characters.

So, let this be a warning: don’t put any special characters in your product name – only put them in your bundle name!

 

As an aside, the issues with broken links on the blog should now be fixed. Sorry for the inconvenience!

iOS Pain Points – the Xcode 4.3 / iOS 5.1 / Lion versioning debacle

Earlier today I wanted to test out March’s application on my iPod, which I had upgrade to iOS 5.1 a while ago. I was quite surprised to see that I was not able to, because “The version of iOS on my iPod does not match any of the versions of iOS supported for development with this installation of the iOS SDK.”

It turns out that in order to run your apps on an iOS 5.1 device, you need Xcode 4.3. Ok, fair enough; I’ll just go and downlo…. oh, wait. It requires OS X Lion.

Huh?

In order to develop for a minor revision of iOS, I need a minor revision of Xcode, which requires an entirely new operating system?

So, my options are now:

  1. Upgrade to Lion
  2. Downgrade to IOS 5
  3. Hack Xcode 4.3 to run on Snow Leapoard
Since there appears to be no officially supported way of doing #2 or #3, my only choice is to upgrade to Lion.

Thanks, Apple. Nice to see you still have no respect for your developers. At least I’m not the only one who feels this way.

iOS Quick Tips – Fading in a UIView with a transparent background, but not transparent contents

For March’s (slightly delayed) app, I wanted to fade in a UIView. Easy enough, right? Well, the catch was that I wanted the background to be partially transparent, but I didn’t want the contents of the view to be transparent.
My first attempt was simply to animate the view’s alpha value from 0 to 1:

view.alpha = 0;

[UIView beginAnimations:@"fade in" context:nil];
[UIView setAnimationDuration:3.0];
view.alpha = 0.5;
[UIView commitAnimations];

This didn’t quite do the trick; although the view’s background was transparent, so were its contents. Oops!

After doing some searching, I found a StackOverflow post which suggested to use colorWithAlphaComponent to set the view’s background color, instead setting the view’s alpha. So here was attempt #2:

[view setBackgroundColor:[[UIColor blackColor] colorWithAlphaComponent:0]];

[UIView beginAnimations:@"fade in" context:nil];
[UIView setAnimationDuration:3.0];
[view setBackgroundColor:[[UIColor blackColor] colorWithAlphaComponent:0.5]];
[UIView commitAnimations];

This wasn’t quite right either. The view’s contents appeared fully opaque as soon as the view was displayed, before the background had faded in!

So, to fix this problem, all we have to do is use a combination of the methods. Use colorWithAlphaComponent to fade in the view’s background, and use alpha to fade in the contents of the view:

[view setBackgroundColor:[[UIColor blackColor] colorWithAlphaComponent:0]];
label.alpha = 0;

[UIView beginAnimations:@"fade in" context:nil];
[UIView setAnimationDuration:3.0];
label.alpha = 1.0;
[view setBackgroundColor:[[UIColor blackColor] colorWithAlphaComponent:0.5]];
[UIView commitAnimations];

Success!

Of course, you can’t actually see the fade in animation in the screenshots, so here’s a sample project that demonstrates the problems and the solution.
Download the Sample Project

iOS Pain Points: Xcode debugger failures

If you’ve ever done much iOS development, you’ve probably experienced the fun of Xcode debugger failures. One of the most popular ones is a hang at ‘Attaching to (name of your app)’, which seems to mysteriously appear once in a while. The StackOverflow post for it lists dozens of possible solutions, some or all of which may accomplish absolutely nothing. In my most recent case, none of the fixes mentioned solved the problem. I eventually rolled back my changes (thanks to ‘git reset –hard HEAD’), and things started to work again.

The sad part? My changes consisted entirely of adding icons to the project and setting up the Icons plist. I’m not sure what bizzaro world Xcode lives in where adding icons to a project is enough to completely and utterly destroy the debugger, but somehow that was apparently the case.

As if that wasn’t enough, I ran into another issue shortly thereafter. This time it was the ever-popular ‘Couldn’t register (name of your app) with the bootstrap server’. Fortunately, StackOverflow came to the rescue once again, and I was back in business after a reboot.

It’s really quite depressing that Visual Studio 6 – which is almost 15 years old at this point – offered a better overall debugging experience than even the newest version of Xcode.