Updating apps for iOS 6 and iPhone 5

Categories: Objective-C

Today is new iPhone day, always fun for iOS developers. Here are a couple of my findings on updating for iOS 6.

iOS 6 Autorotation

My iPad version of MASH had rotation issues, and wasn’t registering orientation changes. First, I discovered that the shouldAutorotateToOrientation method of UIViewController had been deprecated in iOS 6, but modifying my code to use the new -(BOOL)shouldAutorotate and -(NSUInteger)supportedInterfaceOrientations methods weren’t working either.

After further investigation, I found that I had some legacy code in my app delegate from the days of [window addSubview:viewController.view]. If you have this code in your app delegate, you’ll want to be sure to update that to the newer:

window.rootViewController = viewController;

Doing this will allow your app to either pull rotation preferences from your Info.plist or allow you to set them in code using:

-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;

or using the shouldAutorotate and supportedInterfaceOrientations methods in your view controller code.

iPhone 5

Adjusting the height of your iOS apps for the new iPhone 5 can also be a temporary roadblock. Your views might look right in the iOS simulator, but you might find that buttons near the bottom of the screen aren’t tappable/responsive. This is because the view controller’s view isn’t clipping subviews. The view is likely still reading it’s frame size from the NIB, which is sized for the 3.5 inch rather than 4 inch display.

I solved this problem by setting the window frame to the main screen bounds in my app delegate’s didFinishLaunchingWithOptions method like this:

[window setFrame: [[UIScreen mainScreen] bounds]];

Those are a couple of my findings. As you test and update your apps for iPhone 5 and iOS 6, maybe these tips will come in handy. I’d be interested to know if you ran into any issues with updating apps for iPhone 5 and iOS 6, too.

Bad News for Indie Game Developers: iTunes 9 and the new App Store [Updated]

Categories: iPhone Objective-C

UPDATE: Games subcategories are now back, after a few day hiatus. (Thanks Apple!) The following post is kept for posterity.

So Apple announced some new iPods and a new version of iTunes (iTunes 9) yesterday at their annual September music event, and heralded the iPod nano video camera, the larger capacity iPod touch, and the iTunes LP and Home Sharing functionality of iTunes 9. The iTunes Store got a redesign, and in some ways is a major improvement over the last version. The addition of the Top Grossing apps category should provide much needed exposure to the more “expensive” games and apps that were previously buried below a swath of inexpensively produced titles. This change might even make a difference in combating the “race to the bottom” price wars.

But I think something is being lost in the changes to the App Store in particular, and I believe it’s vital for independent developers to consider this change. The desktop version of the iTunes Store no longer (as of this writing) breaks down the Games category into sub-categories (like Action, Arcade, Kids, Word, etc.), meaning that even top ranking titles in those sub-categories are being relegated to less prominent corners of the store.


Before: Games category in the iTunes 8 App Store featured New and Noteworthy, What’s Hot, What We’re Playing, and sub-categories. Hey, what’s that? Oh, it’s Liberty Boom!


After: Games category in the iTunes 9 App Store only features the Top Paid and Top Free apps, along with the rapidly growing list of recent releases

I’m writing about this because I believe it could affect indie game developers (myself among them). My first iPhone title, MASH (iTunes link), fluctuates between the top 20 and top 10 Kids and Word games, in both paid and free categories, and I believe this is partly due to the continuing visibility it has in the App Store’s Kids and Word Games sections. Likewise, our most recent title, Liberty Boom (iTunes link), could be found in the top 75 Family Games. Liberty Boom was also recently featured in the New and Noteworthy Games category. (New and Noteworthy is now applied to the whole of the App Store.)

Currently users of the device version of the App Store are able to browse by sub-categories in Games, and I’m hopeful that the removal of this functionality from the desktop version (where filtering and refinements make significant sense) is merely an oversight of the iTunes Store redesign and/or a planned update. There’s also an outside chance that it will actually in some way help titles that are primarily marketed apart from the App Store or spread by word of mouth to stay ahead of the throng of (in my opinion) lower quality “me too” apps. But the simple fact is that the majority of people still use iTunes to find new titles to download and purchase.

I believe it’s necessary to provide a means for larger budget titles to stand out (e.g. the Top Grossing category), but burying independent developers, the people who really made the App Store what it is today, shouldn’t be the flip-side of the solution.

I’d love to hear what you think about the changes. Please let me, other developers, and Apple know in the comments.

MASH and MASH Lite Status Update

Categories: iPhone Objective-C

At the end of January I released MASH for the iPhone and iPod touch, at an introductory price of 99 cents (as of this writing, MASH is on sale in the App Store for 99 cents, but will go back to its regular price of $1.99 in the next week). To date MASH has been met with very good reception, considering I conducted very little marketing, as it were, and no paid advertising - I predominantly used social media outlets like Facebook and Twitter to get the word out.

The real surprise, though, is the response from users for MASH Lite, the free version of the app, available on the App Store for the last week and a half. In that time it rose quickly to the top 20 and now the top 10 of the Kids game and Word game categories, and has had very favorable four and five star reviews in several countries. It’s been downloaded about 11,000 times so far. The app is running sparse advertisements, and this weekend (Saturday and Sunday) had over 50,000 ad impressions.

Additionally, I just discovered that I received my first payment from Apple for the first week MASH was available (the last week in January). Although I won’t disclose the amount, I will say that it took a little under a month for the transfer to be processed and go through.

If you own an iPhone or iPod touch, I really recommend checking it out. More information is on my website, Magnate Interactive.

What I learned while developing for the iPhone

Categories: Adobe Flex AS2 AS3 iPhone Objective-C XCode

Now that MASH, my first game for the iPhone and iPod touch, has been in the App Store awhile (more info here: http://magnatemobile.com/apps/mash), I thought I’d take a moment to jot down some of my thoughts on the experience and what I learned, not having done Cocoa or Mac development previously.

I came to Objective-C having had the bulk of my programming experience using scripting languages like ActionScript (AS2 and AS3), JavaScript, and PHP, as well as a fair amount of C# and Java. The transition to C style syntax and methodologies wasn’t a giant leap, but there was definitely a learning curve involved. These are some of the things I learned.

Coming from Eclipse-based IDEs, I was used to having the file and folder structure of my project in the editor match up to the structure I’d see in Finder (or Explorer if I was on Windows) - in XCode, though, you can arrange and re-arrange the files and groups within the editor without actually changing the location of the corresponding item in the filesystem. I’m still not sure if I like this - there are times when I want to re-arrange files (especially the location of graphics) in my project using Finder’s column view instead of XCode’s list view.

Know when to retain and when to release. Releasing an object that you needed to keep will cause your program to crash. Seems like a no-brainer, but not understanding why my app crashed when I would invoke a “Start Over” method I created had caused me to spin my wheels for about a half hour. Additionally, take care not to “over-release” an object - the console will spit out malloc warnings that aren’t self-evident as to their cause.

When it comes to creating an app from the get-go with multiple languages in mind, creating a Strings file first and then using NSLocalizedStringFromTable is one way to do localized strings, but isn’t necessarily the conventional way. After having implemented localized strings that way first, I later learned that XCode has a process for writing your code first with the strings you intend to use, and then allowing the compiler to handle creation of the necessary files.

XCode does a very nice job with HeaderDoc documentation. It’s much easier to use than Flex Builder and ASDoc, in my experience. HeaderDoc doesn’t try to document every class in your project like ASDoc does by default, just those you tell it to.

You may have heard horror stories about long waiting times and applications rejected for seemingly trivial or vague reasons - while that hasn’t been my experience, I will say that the process for submitting an application is less than ideal. It takes a lot of time, forms ask for information in a strange order (this isn’t exactly the process, but on some form pages it’s a little like: enter the information about your app, then choose graphics to upload; after clicking to upload the graphics and the page refreshes, the previously entered form information is wiped out and you have to enter it again - frustrating!). Submission to approval time for my app and updates have been fairly quick so far, less than a week from “In Review” to “Ready for Sale”, so I don’t think I can complain about long waits, although the anticipation of not knowing if your app will be approved or rejected is bad enough.

Overall, I’ve enjoyed the process of learning to develop for the iPhone. I’d imagine the learning curve is probably steepest for those without previous object-oriented development experience, but for anyone with a good idea and a willingness to learn (and shell out for tooling and a developer certificate), I’d say the effort has been worth it.

PhoneGap - Write native apps for iPhone, Android, and Blackberry using JavaScript

Categories: Adobe AIR Frameworks iPhone JavaScript Objective-C RIA WebKit

From the site (http://www.phonegap.com/):

“PhoneGap is a development tool that allows web developers to take advantage of the core features in the iPhone, Android, and Blackberry SDK using JavaScript.”

PhoneGap essentially wraps a web view (WebKit on the iPhone) in a native app container, giving the web application access to core device APIs. This should go over well with the Adobe AIR crowd that’s already been sold on the idea of repurposing their web-based apps as “native” desktop apps, who are also interested in bringing that software to various mobile devices.

What will the programs created in this manner be called? Rich Internet Applications? Native Web Applications?

I’m a big proponent of web-based applications, but only inasmuch as they allow fairly ubiquitous access to data across devices. My biggest beef with web apps, though, is that they are much less responsive than native applications. Alright, let me rephrase that - a web application will always be inherently slower than a native app. I/O for the data model aside, a web app also has to contend with the fact that both its data and the presentation logic for the data must trickle over the wire or over the air (and then be rendered) before anything useful can be done with it. Native applications simply do not have to deal with the presentation waiting game.

So the scenario I see PhoneGap being used for is something like: provide as much presentation logic/code as possible in a local data store that gets installed with the app, and only download data for the user when necessary. Cache things that won’t change often. Use device APIs for storing user data locally and for things like geo location.

I’m excited about the prospects of using JavaScript (something fairly easy to pick up) to create “native” web apps for mobile devices. But I’m also aware that the speed, feel, and device integration of a true native app (especially if it gets its data from the web) will beat web applications in those same criteria for the foreseeable future.