Search VG Five
Categories & Tags

Entries in iphonedev (7)

Wednesday
06May2009

NSString - Comparing two strings in Objective-C

Comparing strings in Obj-C is not done the same way as comparing two integers, bools, or even characters. For example, the following code will fail to get the desired results:

if (someString == @"someText") { // do stuff }

This will never run, because you are comparing pointers and not the content of the two strings. Instead, use this:

if ([someString isEqualToString:@"someText"]) { // do stuff }

 

Wednesday
29Apr2009

App Store Roundtable: The Gold Rush

Gavin Bowman has posted the first App Store Roundtable summary on the topic of "The Gold Rush." You can find it over at The Apple Blog.

I recently joined the Rountable and look forward to contributing to it. I think it's an excellent idea and a way to spur discussion between devs.

Wednesday
29Apr2009

The iPhone penny rush

I'm sure by now that most independent developers on the iPhone have realized a basic fact: Unless you're insanely lucky or well connected, the "Gold Rush" is much like its San Francisco cousin, circa 1849. Most devs are not going to become overnight millionaires from their iPhone apps.

However, this does not mean that the independent developer should give up. Afterall, there are more than 30 million iPhone OS users out there. If 10 percent of them use the App store (surely a conservative estimate), that means 3 million people will potentially be exposed to your app. If one percent of those people buy your app, that's 30,000 sales. These aren't the kind of numbers we see most apps move, but anyone can see the logic in developing for the platform. With a good idea, a solid plan, enough time, and a bit of luck, anyone can see some generous income from iPhone development.

Now, in the real world, let's imagine that Joe the Dev has written his first iPhone application. Joe is 25 and works full-time at Mr. Finance, a job that pays him $30,000 a year. Joe doesn't mind his job, but sadly he never went to college and he's unable to find a better paying one. Seeing the amount of money that the media is showing some iPhone developers as making, Joe saves up some money and buys a refurbished Mac Mini along with some iPhone dev books and a $99 developer's account. Joe spends about $600 to get into iPhone development.

For a few weeks, Joe studies and codes and finishes his first iPhone app. It's not a game (Joe knows notihng about graphics), but "Joe's App" seems to Joe like something that people would be willing to purchase for $0.99. He sends it off to Apple and 20 days later (and after one rejection from Apple... Joe should have read the Human Interface Guidelines more carefully) it appears on the App Store. Having done his homework, Joe knows to update his release date to appear on the top of the Release List in his category.

Joe anxiously awaits his sales results. As he downloads and opens his first daily report, Joe is saddened to see that only 10 copies of his app sold. He's made a mere $7. As more days go by, his app drops down to no daily sales after selling 20 copies in the first week. Joe contemplates quitting iPhone development.

However, Joe stumbles upon some simple math:

If Joe spends a few hours a week to develop and keep updating a handful of apps (along with a little word of mouth), he stands a reasonable chance of selling an average of 10 copies combined between them all each day. If he can do that for a year, he'll bring in pre-tax (post-Apple) earnings of around US$2500. Not bad for someone with a full-time job to supplement their income. If Joe commits himself even more, he can raise that number by developing more apps and spreading the word about his projects.

Joe's story is the perfect example of what I call the penny rush. Much like any other market, not everyone is going to  be the big dog on the pile. There's plenty of room for a lot of smaller dogs to gnaw on the collective chew toy.

Tuesday
28Apr2009

Easy custom UITableView drawing (via Cocoa with Love)

Matt Galagher of Cocoa With Love has a great tutorial posted on how to draw custom UITableViews without spending as much time on them as I myself am guilty of. He lays everything out very well and even provides the project source for reference. Perfect timing for this as I'm working to expand the features of my Go series of apps and this is exactly what I am looking to do.

Monday
27Apr2009

Weekend Challenge Results - Twitter Client

Note: Been a busy week+ with bug squashing and devtime on other projects (plus house hunting, more on that later). Full source will be distributed when I get around to it. Sorry for the delay!

Nice weather can really ruin a goal that involves being inside for most of the weekend. Luckily, I managed to strike a balance between spending some time outdoors and still finishing up the challenge in time. While my Twitter client is not polished, it is functional and met the goals that I set out on Friday. I will be updating this post with some snippets for the important functionality later today.

This project took approximately 6-7 hours of coding in all, but that could easily have been reduced if I'd come in with knowledge of Basic Auth to use with Twitter's API. Being that this was meant to be a learning exercise, I'm pretty happy with the total dev time. It obviously would have been more if I'd started from scratch, but a weekend project means you use all the shortcuts available.

I started with a Utility Application framework in XCode, which set up most of the core functionality that this application needed. Running it just after creation resulted in a main view with an Information icon that flipped to what would become the settings view. A "Done" button on the flipside view returns to the main view. From there, all it took was some layout design and coding to make a functional client.

The Main View

This section will be updated soon. As I was preparing for this post, I realized a better way to doing the authentication with Twitter. Don't want to put out "bad code" since the second it hits the web, Google will make sure it stays out there. Stay tuned.

I utilized TouchXML to parse the API's response to my query, which handled everything nicely. I've used it before with iGoozex, and there's a great tutorial to get started with TouchXML over at dblog.com.au.

The Settings View

You can download the source files for this view: TwitterClientSettingsView.zip

The settings view is pretty simple. It loads the user defaults and sets the view's contents to reflect them when it loads. When you press the Done button to return to the main view, the settings are saved back to user defaults. Pretty self explanatory.