Archive for the ‘Software Development’ Category

Some Useful Books for iOS Developers

Monday, July 26th, 2010

Last week I had the opportunity to teach a one-day class on learning iPad programming. One of the students asked what books I recommend. A friend asked the same question over the weekend, so I thought I might as well post the list of books on iOS and Objective-C programming I have found helpful.


A Really Simply Timer

Monday, July 19th, 2010

SimpleTimer.pngA friend asked if I would put together a sample iOS app that shows how to display a stopwatch timer like the one used in Labor Mate. It seemed like a fun exercise to break up the night, so I said, “Sure, why not.”

I decided others might find the sample source code useful so I posted the project to github for all to enjoy. The piece devs might find interesting is the KTStopwatch class. This is a simplified version of the class I use in Labor Mate. It supports wall clock and elapsed time.

The source code is licensed using The MIT License, so do with it what you like. Enjoy.


Sale Numbers are In: An Update on My App Store Pricing Experiment

Friday, July 2nd, 2010

Last month I mentioned my experiment with the pricing for Labor Mate to see what effects, if any, a price increase will have. The initial results were interesting. The number of units sold went down, but revenue had gone up. On the surface it seems the price increase was a success, but I needed more data.

I increased the price of Labor Mate by $1 on May 15, going from $0.99 to $1.99. By increasing the price on May 15, I was able to compare the first half of the month with the second half. And as I mentioned in the previous post revenue had indeed gone up. But I was curious to see if this would continue and what might be the long term effects, so I left Labor Mate at $1.99. After all, I made more money in May as a result of the price increase.

June is over and the sales numbers are in. I’m now able to compare a full month of sales (for June) at the higher $1.99 price to a full month of sales (for April) at the lower $0.99 price. And I can compare these numbers to May’s numbers. The results might be surprising to some, but are inline with what I secretly thought would happen.

In June, Labor Mate earned a whooping $31.94 more money than in April, and it earned $30.90 less compared to May. In April, Labor Mate averaged $35 per day. The average was $37 per day in May, and only $36 per day in June.

Revenue from Labor Mate has been on a slow but steady increase since it was first released back in 2008. Though I cannot prove it, based on past trends, my gut tells me Labor Mate would have likely hit June’s revenue number in May without the price increase. And my gut, again based on the trend, says June would have probably hit May’s number without the price increase. In other words, while the price increase did improve Labor Mate’s revenue, the amount of additional revenue resulting from the price increase is actually no different from the slow and steady increase in revenue I was already seeing at the lower, 99 cent price point. As a matter of fact, I saw a bigger jump in revenue between March and April, with April bringing in a whooping $175.71 more than March.

I’m now convinced the price increase did little to improve revenue, and actually the price increase likely did more harm than good. Prior to the price increase Labor Mate was ranked in the Top 100 in the Health and Fitness category for a number of different countries including the U.S. Today Labor Mate is no were near ranking in the Top 100 in most stores.

Another negative effect caused by the price increase is that fewer people are now using Labor Mate. As I noted in the previous post, the number of daily downloads dropped. This means fewer people are buying Labor Mate, which in turns means fewer people are using it. I believe Labor Mate’s slow but steady raise was due in part to word of mouth advertising. Now that there are fewer new moms and dads buying and using Labor Mate, there are fewer people recommending Labor Mate to other new moms and dads. And I admit, ignoring price for a moment, I’m a little disappointed that fewer people are using the app. A part of me prefers selling at a lower price point so more mom and pops to be will use it. (Hmm, maybe I should release a free, iAd supported version.)

So what’s next? I’ve thought about dropping the price back down to 99 cents, but this could lead to a backlash from the folks who purchased Labor Mate over the last 6 weeks. Plus, $1.99 is still cheaper than a large cup of Starbucks coffee. The better idea, and the one I have been planning all along, is to continue improving Labor Mate and make it stand out above the other 99 cent copy cats. This includes leaving the price at $1.99 for now. After all, as one recent new user said to me in email, “it is a very practical and intuitive app and certainly justified at $1.99.”


Using UIPopoverController with iOS 4

Thursday, June 10th, 2010

I ran into an interesting bug today while testing Hey Peanut on iOS 4. For those who don’t know, Hey Peanut is a universal binary, which means it runs on both the iPhone and iPad. My iPhone has the GM version of iOS 4 installed on it, which I’m using to test my apps under iOS 4.

Because Hey Peanut can run on both the iPhone and iPad, my code must include certain checks to avoid crashes. One check the code makes is to determine if the class UIPopoverController is available or not. Prior to iOS 4, this class was only available in iOS 3.2. The current release of iOS on the iPhone is version 3.1.3, and it does not include this class. To make use of the popover I use code such as the following:

   Class popoverControllerClass = NSClassFromString(@"UIPopoverController");
   if (popoverControllerClass) {
      popoverController_ = [[UIPopoverController alloc] initWithContentViewController:[self imagePicker]];
   }

Turns out there is a big problem with this code under iOS 4 causing Hey Peanut to crash each time. It wasn’t obvious to me at first why this code was failing but as I thought it more, and as I talked through the issue with an Apple engineer, I realized, “Duh! iOS 4 is running on the iPhone, not the iPad.” Simply checking for the existence of the class isn’t good enough any more. Instead, I need to also check the device type. So with a quick change to the code, shown below, I was able to fix the crash in Hey Peanut. The code now checks that the class is available and is running on a iPad.

   Class popoverControllerClass = NSClassFromString(@"UIPopoverController");
   if (popoverControllerClass && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
      popoverController_ = [[UIPopoverController alloc] initWithContentViewController:[self imagePicker]];
   }

Some Really Useful Xcode Plugins

Friday, May 28th, 2010

Xcode is a suite of developer tools for Mac and iPhone programming. Xcode is also the IDE included in the developer tools. As far as IDEs go, Xcode has become my favorite over the years. It’s simple yet powerful. But as good as it is, there’s always room for improvement, so yesterday I asked on Twitter, what plugins do other Xcode developers find useful? Turns out there are a number of really useful Xcode plugins. Here is the list of favorites based on responses to my tweet.

Code Pilot is by far the favorite based on the number of responses I received. Code Pilot provides easy navigation through your Xcode project. If you are a keyboard junkie like me than you owe it to yourself to try out Code Pilot.

Accessorizer is the second most popular plugin. Accessorizer saves you time by generating boiler plate code for you. For instance, you can use Accessorizer to generate the @property declarations based on a set of ivars. Give the Accessorizer Quick Start Guide (PDF) a read to get a sense of what Accessorizer can do for you.

Mogenerator tied for second most popular plugin. It generates Objective-C code for Core Data models. It works differently than Xcode in that Mogenerator manages two classes per entity, one intended for the machine and the other intended for humans. The Mogenerator sites says, “The machine class can always be overwritten to match the data model, with humans’ work effortlessly preserved.” Perfect for Core Data projects. FYI, Mogenerator is an open source project created and maintained by the most-excellent Jonathan ‘Wolf’ Rentzsch.

Completion Dictionary is a free plugin that enhances Xcode’s own code completion. It allows you to define your own expansion macros. You type a few letters and press the completion shortcut. You instantly have new code added to the file. This plugin reminds me of Delphi Live Templates, which I used religiously back when I did lots of Delphi programming. Oh, and did I mention Completion Dictionary is free?

What other Xcode plugins are out there? Which ones do you find useful? Post a comment if you have a favorite plugin not listed here.


It’s Official. I’m Nuts.

Friday, May 28th, 2010

Turns out I’m nuts, and I can prove it. Last week a signed a contract to publish a book with Addison Wesley. Justin Williams at SecondGear put it best when he asked, “ARE YOU NUTS!?” Yep, apparently I am. And signing the book contract is my proof.

Kidding aside, I’m very excited about this opportunity to contribute back to iPhone development community, a community that has been extremely helpful to me over the last couple of years. The book is on learning iPad programming. It will focus on the unique aspects of programming for the iPad and will hopefully serve as a launch pad for many new iPad programmer entering the space.

Writing on the book has just begun, and I have a very aggressive 6-month delivery schedule. My life is going to be busier than ever over the next 6 months, but it will be a good busy as this is something I have wanted to do for a long time. So if you don’t hear from me much between now and November, you know why.


Learning While Watching Myself

Thursday, May 20th, 2010

The video recording of my 360idev talk “Building Web Service Powered iPhone Apps” is now available from 360idev (free to attendees, for purchase for non-attendees). This was the first time a presentation I gave was recorded, and for the first time ever I get to see my own talk. I watched the video yesterday and overall I’m happy with the results. The best part for me, however, is using the video to learn from my mistakes.

A mistake I repeatedly made was not repeating questions asked by the audience. Repeating the question is an age old speaker tip, but the tip is easily forgotten during an actual presentation. Repeating the question is helpful to others in the audience who may not have heard the original question. Repeating the question also gives you a chance to make sure you understand the question, and it buys you a few more seconds while you think of an answer.

Repeating the question becomes more important when your session is being recorded. In the case of the 360idev recording of my session, you cannot hear questions from the audience. This sometimes makes it hard to understand the context of the answer. I could have avoided this by repeating each question before providing an answer. The lesson learned here, and one I must remember the each time I speak, is to repeat the question before answering.

The other lesson I learned by watching my session is to not do live coding. Live coding can be impressive, earning you some respect points with audience members. But live coding can also slow down the presentation. This is what happened in my session. There are lulls during my talk while I type code from memory. Also audience members will often see mistakes in your code as you type and shout out tips. This can break your thought process causing confusion and delay.

Having now watched my session video I have decided to no longer do live coding in these types of sessions. The extra time spent typing on the keyboard is better spent sharing additional knowledge with the audience.


Section 3.3.1 Does Not Prevent Cross Platform Development

Tuesday, May 4th, 2010

Apple has come under fire over its latest developer agreement for iPhone OS developers. The section causing concern is 3.3.1 which says applications must be originally written in Objective-C, C, and C++ (or JavaScript when using the WebKit engine). This restricts developers from using other cross-platform development tools such as Adobe’s Flash CS5 packager.

Steve Jobs has clearly explained his thoughts on Flash, but more importantly he talks about the impact felt from third party cross platform development tools. Those of us who have been in the software industry long enough will likely agree with Steve’s comments regarding the impact cross platform development tools have on software development.

An interesting fact: An abstraction layer separating the developer from the platform does not have to come from a third party to cause problems. When Microsoft first released Windows 7 the only way to take full advantage of the new features was to use a development tool that allowed the developer to talk directly with the platform, in this case the Windows API. This may come as a surprise to some but it meant you could not use .NET including C# to tap into the newest Windows 7 features. Microsoft’s own layer, the .NET Framework, prevented C# developers from tapping into the latest features in Windows 7. A developer’s only option at the time was to use Visual C++ or Delphi.

For years programmers have dreamed of some magical development tool that would allow them to write code once and run it anywhere. Sound familiar? That was the promise made by Java over a decade ago. Guess what. It never really happened. Most cross platform applications are subpar and do not feel or behave like applications written specifically for the platform.

This brings me to a comment I read this morning in an article speculating Apple may change the iPhone developer agreement to avoid an antitrust case.

“Mobile advertiser Greystripe’s CEO Michael Chang has explained that writing an app using Flash CS5 for the iPhone could cost $75,000 initially but would cost just a few thousand dollars more to port to Android. Without Adobe’s tool, however, developers could be forced to rewrite from scratch and spend as much as they did before. The sheer expense could be considered anti-competitive as it would make writing for more than one platform cost-prohibitive for smaller studios.”

First of all, writing a top quality cross platform application is hard and costly. It doesn’t matter what development tools you are using. Second and more important, when did Flash CS5 become the only cross platform development option? Last time I checked C and C++ were considered cross platform programming languages with C being one of the more popular options for cross platform development. The iPhone developer agreement doesn’t restrict the use of these cross platform programming languages.

Yes, it would be great if cross platform development were cheaper but to say the expense associated with cross platform development should be considered anti-competitive is just down right stupid. The developer agreement is not preventing cross platform development. It is preventing the use of third party cross platform abstraction layers that separate the developer from the platform.

Why stop with Flash? Let’s start a petition against Apple because I can’t use my favorite programming language, Pascal. I think I should be able to use Pascal as my programming language of choice and not just for iPhone OS development. I want to use Pascal for any device and platform. Pascal should be a first class programming language for the Kindle, PSP and DSi, and Amazon, Sony and Nintendo should be responsible for making this happen otherwise face accusations of being anti-competitive.

This grumbling about section 3.3.1 in the iPhone developer agreement boils down to two things:

1) Businesses want to reduce development cost.

2) There are lots of lazy programmers out there.

Let’s discuss these 2 points a bit further. Building a cross platform application using a tool like Flash CS5 might help businesses reduce development cost. Will it help a business be successful? Maybe and maybe not. Success depends on whether or not customers like the apps produced by the business. Personally I dislike non-native apps because most are subpar and behave differently. If the apps are subpar then a business will likely not succeed despite using third party cross platform development tools and saving a few dollars in development cost.

Now on to lazy programmers. Actually saying “lazy” is probably the wrong word to use. I often say I’m a good programmer because I’m lazy. I don’t like to repeat the same task over and over, so I write a program to do the task for me. This makes me lazy because I find ways to reduce the amount of work I need to do. So being a lazy programmer can actually be a good thing. The DRY principle is another example of being a good type of lazy programmer.

In my second point I’m referring to a different type of lazy programmer, a bad lazy programmer. This is typically a programmer who does programming as a job and programming is just that, a job. This type of programmer doesn’t have the same love for programming that someone like me has. This type of programmer isn’t interested in learning new programming languages and this type of programmer definitely is not the type who would be programming even if he or she didn’t get paid to do it.

The bad lazy programmer wants everything to be easy. He wants to write an app once and have it run everywhere. He’s main goal is to move up the corporate ladder in hopes of making more money. And what better way to move up the ranks than showing your company how it can reduce development cost by using a third party abstraction layer and tool.

These are the types of programmers complaining about section 3.3.1. Programmers too lazy to learn a new programming language such as Objective-C, C or C++. Yes, these languages are harder to learn than many of the newer programming languages including those fun scripting languages used by many today. And yes, I might be a little basis because I first learned C over 25 years ago and I have no problems using it today. But instead of bitching about terms in the developer agreement why not accept the fact that cross platform development is hard and costly. After all you can still use the same C and C++ code in both iPhone and Android apps. Yes, that’s right. The Android NDK (Native Development Kit) does exists and allows C and C++ code to be used to implement parts of your application. It’s not easy but it’s possible.

Adding more fuel to my fire is this comment in NY Post article from yesterday:

“Regulators, this person said, are days away from making a decision about which agency will launch the inquiry. It will focus on whether the policy, which took effect last month, kills competition by forcing programmers to choose between developing apps that can run only on Apple gizmos or come up with apps that are platform neutral, and can be used on a variety of operating systems, such as those from rivals Google, Microsoft and Research In Motion.”

Yes, exactly what world needs. Apps that are platform neutral. But wait! Don’t we already have that today in the form of web-based apps? And doesn’t the iPhone and iPad come with Mobile Safari capable of running web-based applications “that are platform neutral and can be used on a variety of operating systems”?

Ah, but you say you want native built apps that take advantage of the platform. That’s cool. You can have that too. But this notation that you can have a native built app that is also platform neutral is just crazy talk. It’s not going to happen anytime soon and it shouldn’t be Apple sole responsibility to make it happen.

I wonder, if Objective-C were more popular would the torch carrying mob go after Google, Research in Motion, and Microsoft for not supporting it on their mobile devices?


Universal App Option is Great But

Wednesday, March 24th, 2010

The iPad release day is less than 2 weeks away and like many iPhone developers I’m scurrying along to get my first iPad app submitted before the deadline. The introduction of the iPad as a new target platform means developers can choose to target the iPhone only, target just the iPad, or target both within a single application. The last option is called a universal binary and is recommended by Apple.

The user benefits with the universal option in that the same application can run on each iPhone OS device. In other words, the same app will run on a user’s iPhone, iPod touch, and iPad. Best of all the user only pays for the app once even if the app is used on multiple devices.

I’m a fan of universal. It makes the buying decision easier for the user. Buy the app and it will run on all your iPhone OS devices, the ones you own today and the ones you might buy tomorrow. The user doesn’t have to think, “I have an iPhone but I might buy an iPad soon. Should I buy the iPhone only version or the version that will run on both?”

The universal also makes it easier for the developer with regards to app naming and marketing. With a universal app the developer has only one app, which means only one app name and one app icon. The alternative is to release multiple editions for the app, each with its own unique name such as “App XYZ”, “App XYZ for iPad”, “App XYZ Universal”, and so on.

Marketing with a universal app is easier too because the developer is marketing a single edition of the application. The developer doesn’t need multiple app descriptions or web pages for each app edition. But the universal option is not without its problems.

First, what happens if the developer already has an iPhone app in the App Store. Can a new build of a universal binary be submitted as an app update? Can it be submitted as an update before the deadline for launch day? If not then that means a new app must be created which means having different app names. And of course existing ratings and iTunes comments will not appear for the newly created app.

Another issue comes to mind. To the developer, a universal app might feel like writing two separate apps wrapped into a single binary. The user experience, the views, navigation, artwork, etc will likely be different for the app when run on the iPad versus the iPhone. This complicates the code base for the developer, which increases the chances for bugs. The developer can overcome this by separating logic in the code and performing additional testing, but this increases the development cost for the application, which leads me to pricing. Higher development cost can lead to higher pricing.

Pricing is a big issue for me. Will users pay more for an app on the iPad, especially if the iPad version has more features, features not feasible on the iPhone? I think so. But will the user who only owns an iPhone with no plans to buy an iPad pay more? I think it’s less likely.

A desktop app typically costs more than an iPhone app, and since the iPad is closer to the desktop than the iPhone in terms of its ability, especially for productivity apps, it makes sense to me that an iPad app will cost more than it’s iPhone equivalent. Will the higher price for a universal app mean the developer will likely loss out on app sales from iPhone and iPod touch users? Or will there be another race to the bottom (i.e., 99 cents) in terms of pricing for universal iPad apps? I certainly hope not.

A developer can get around this by releasing 2 editions of the same app, one for the iPhone only at lower price point and a second universal app at a higher price point. But now we’re back to complicating the buying decision for the user with different editions of the same app. The user is back to thinking, “Which edition do I need? Which one should I buy?”

I already asked will iPad app pricing race to the bottom like we saw with iPhone apps, and again, I certainly hope not. Developers will be able to do much more on the iPad which will justify the higher price. But should developers expect iPhone and iPod touch only users to pay $9.99 for an app not as feature rich as the iPad equivalent? Or should iPad apps limit functionality to only what is feasible on both devices for the sake of a lower price point?

I wish I had answers to these questions. I’m sure the answers will become clear once the iPad has been released and developers see and understand more, but for know I’m left scratching my head as I ponder these questions.


Quickly Create New FogBugz Cases with Tickets

Monday, January 18th, 2010

I’ve been a FogBugz user for nearly 5 years. To say I rely on FogBugz is an understatement. It is a critical component in my software development process allowing me to track bugs, feature requests, communicate with customers and more across multiple client and internal projects. To date I have logged over 22,000 cases in FogBugz, which I feel is a lot for a solo developer. And yet, if I had a better, more efficient way to create new cases I might have many more in FogBugz today.

The inefficiency of creating new cases in FogBugz comes from the fact that FogBugz is a web-based application meaning you need a web browser. Web-base apps are not always the most efficient way to do something and FogBugz is no exception despite having a really nice web UI. Entering a batch of new cases is slow and having to launch a web browser, go to a web site, etc just to enter a new case is not the quickest process. What is needed is a desktop application that allows me to quickly create new cases in FogBugz. Lucky for me and other power FogBugz users out there, Manicwave has a solution.

Last week Manicwave released it’s first version of a new FogBugz desktop client for the Mac called Tickets. Tickets is by far the easiest, fastest way to create new FogBugz cases.

I had the fortunate opportunity to beta test Tickets prior to the official release. I was hooked within a couple of minutes. The rate at which I can create new cases is simply amazing. Before I started using Tickets there were times I would not create a case. Say for example I’m deep in code and I encounter a bug. Sometimes it was just too much trouble to launch a web browser, go to the FogBugz web site, click New Case, select the project, area, etc, and enter the bug information. Since I rely on FogBugz to track all my work, especially client-specific work, not logging a task or bug was a big no no for me. But I admit there were times when I didn’t create a new case just to save a minute or two. Tickets changes this.

With Tickets I’m only a shortcut keystroke away from creating a new case. Now when I encounter a bug, think of a new feature, or just need to log a task I type the global shortcut key combination and Tickets instantly gives me a new case window. Say I encounter a bug or need to log a task while in Xcode. I type the shortcut key and bam! Tickets displays a new case window for me. The time it takes me to create a new case is only slightly longer than adding a // TODO: to the source code itself. No more of this launch the web browser, go to the web site, etc, etc, etc.

Tickets allows you to rapidly create new cases with attachments. Just drag and drop the files you want to attach. Tickets even includes it own screenshot feature allowing you to capture the full screen, capture a window, capture an area, or capture a timed screenshot.

Tickets is the most efficient way to create new FogBugz cases on the Mac desktop. If you regularly use FogBugz you owe it to yourself to try Tickets.

Disclosure: I was not paid nor asked to post this review. I did beta test Tickets prior to the public release and I did receive a complimentary license for my feedback and participation in the beta program.