Setting up Unit Testing in Xcode 3.1

Xcode includes OCUnit, so you don’t need to get a copy. But, you might want to take a look at their website (http://sente.epfl.ch/software/ocunit/) for information and tutorials on how OCUnit is intended to be used.

If you are planning on doing Test Driven Development (TDD) you may also want to get the following packages:

Other good articles on Xcode Unit Testing that I came across:

By reading through the documents references above I was able to get OCUnit up and running for one of my projects. It took a bit of experimentation, but in the end it looks like OCUnit will work just fine for doing TDD in Xcode with Objective-C. Anyone wanting to try out TDD should give it a try. The benefits for your project are significant. Go for it!

Advertisements

What a bump!

Tonight I was looking at the stats for this blog, mostly because I was curious if any of my recent post have been picked up by google searches or not. Well, the answer to that question is mostly no, but I’ll keep on writing about things I find important.

What really caught my eye was this graph:

Picture 12.png

Notice anything special about July 11th? Yup, that’s the day the iPhone 3G was released. I happened to be one of the brave soles that tried to upgrade my iPhone 2.5G, and I wrote about the problems that ensued. It looks like you just have to talk about the iPhone if you want to drive traffic to your blog!

You can’t keep a good class library down … MFC gets reprieve from death sentence!

A few years ago I was working at a company where we built applications using Visual Studio 6 and MFC. The applications had been around for about 10-12 years, and were all showing their age. Customers were beginning to request updated user interface features like they were seeing in modern Microsoft products such as Office and Internet Explorer. Sadly, we could not deliver these user interface enhancements easily because MFC was not getting any attention from Microsoft.

In late 2002 Microsoft was pushing the .NET Framework, C# and WinForms as the heir apparent for Win32, C++ and MFC. Converting a decade of legacy C++ MFC code to .NET and WinForms just wasn’t an option. We all felt like Microsoft had just abandoned us for greener pastures.

Our solution at the time was to start a long difficult process of moving away from MFC toward a cross-platform class library built by Trolltech, called Qt. In many respects this turned out to be a good decision since it meant we could begin to seriously consider offering our applications on Windows, Linux and the Mac instead of just on Windows. Still, it felt like Microsoft had hung us out to dry.

The WinForms classes just were not rich enough to build complex desktop applications at the time. Many of the conveniences we had come to rely upon from the MFC class libraries were missing and it would have been up to us to roll our own alternatives had we gone down the WinForms route. I think Microsoft was too focused on building web applications to devote sufficient resources to WinForms.

Here we are six years later and Microsoft has announced that they are providing a MFC Feature Pack for Visual C++ 2008 that will add significantly to the capabilities of the MFC class libraries. I can hear MFC development teams all across the Internet celebrating this change in stance from Microsoft.

Here are a couple links to information from Microsoft on the topic:

Couple MFC with a good third-party widget library like the toolkit offered by CodeJock Software and you have everything necessary to build some awesome new desktop applications.

Long Live MFC!

MobileMe Mail Error

Here we go again. Software Update just notified me that “.mac is now MobileMe” and that an update to Mac OS X was available. Being a masochist I went ahead and ran the update. Everything went smoothly for the most part. I was even able to connect to MobileMe Mail using Safari. I logged in successfully and started poking around the web interface. Guess what….

Yup, once again Apple’s servers are not up to the task. Here is the message I was greeted with shortly after the initial user interface was displayed in the browser window:

Picture 1.png

Apple builds some killer hardware, a great desktop OS, a great music device, some excellent applications, and a really cool phone. They just don’t seem to be able to get server computing right though.

I’m not sure if it’s that they don’t allocate sufficient engineering resources to the problems, or if their data centers are under-powered or what, but these problems just aren’t acceptable. This isn’t new territority. Companies in the on-line space such as Google, Amazon, eBay and AOL have been doing this for years. Building scalable, robust server farms that can handle the kind of load .mac subscribers (oops, I meant MobileMe) exert on the infrastructure just isn’t rocket science.

The new user interface in MobileMe looks promising. I just want it to work reliably and to always be there when I need it.

Come on Apple. You make great XServe servers. Throw more of them at the problem if it’s just a resource issue. Looking at the growth of Apple stock share prices, the increased sales of Mac desktop and notebook computers, and the insanely successful iPhone I think you can afford to hire some top-gun server developers if what you need is more engineering talent to correct this problem.

Please, make MobileMe something everyone loves and can’t live without. Show the rest of the on-line world you mean business here!

Finally, accepted into the Apple iPhone Developer Program!

The subject of this post says it all. I just received an e-mail from Apple indicating that I have been accepted into the Apple iPhone Developer Program and that I need to fill out some information to complete the registration process. I sure hope everything goes smoothly. I, like many developers, have been waiting to try my application on the iPhone for months.

Upgrade to iPhone OS 2.0 Fails – Unknown Error (-9838)

The new iPhone 3G went on sale this morning at 8:00 AM and I’m sure there are long lines at various Apple stores around the country. I already have a first generation iPhone and was looking forward to the iPhone OS 2.0 upgrade. Sure, I’ll still have to live with the EDGE network speed when not connected to a WiFi hotspot and I won’t have a GPS, but other than those two shortcomings (and not being able to get one in white) my first generation iPhone is working just fine.

So, this morning when I sat down at my desk and pressed the “Check for Updates” button in iTunes with my iPhone connected it said that the iPhone OS 2.0 update was available for download and installation. I ran through the process and everything seemed to be going well right up until when it restarted the iPhone with the new 2.0 software. Then I get the dialog box shown below.

Picture 3.png

WTF! An unknown error? What sort of an iTunes Store failure is this? My phone appears to be bricked at this point. All I can do is make an emergency call. Oh boy, just what I wanted from Apple! If only I could make an “emergency call” to the Apple technical support line maybe they could let me know what the -9838 error is. I am not very happy right now.

The dialog box says to try again later. Well, I have retried this operation by ejecting and reconnecting my iPhone at least ten times now, and each time I see the same dialog box.

When I get this resolved I will post an update. For now, if you are eager to get the iPhone OS 2.0 I would suggest that your best bet is to go buy a second iPhone. Clearly Apple has not fully baked the iPhone OS 2.0 support for the first generation iPhones. How disappointing!

Update @ 9:05 AM

It is now 1 hour after I started this upgrade process and the iTunes Store is now reporting a different unknown error code.

Picture 4.png

What fun!

Updated @ 10:12 AM

Still no luck getting my phone to work. I am getting the “unknown error occurred (-4)”, and have been for more than an hour now.

There is a discussion of this issue on the Apple support site. Here is the link:

Topic : Cannot connect to store (error -9838): can’t activate iPhone !

Someone at Apple should be held to the flames for not anticipating this sort of issue and taking steps to eleminate it. They had very similar problems when the first generation iPhones were released and people couldn’t activate them.

Think Different, indeed….

Updated @ 10:20 AM

Finally!

Picture 5.png

Apple is very fond of reminding people that they build great user interfaces for their applications. Here is a perfect example of where they failed miserably. I think a lot fewer people would be complaining about this server scalability issue if the iTunes application had a “retry” button. Instead of just asking you to try later the software should do that for us. After all, the computer is more than capable of retrying the connection until it succeeds. There is no reason at all for all of us humans to be sitting here clicking on play lists and then clicking on the iPhone item and then waiting for an error and then repeating the process FOR TWO AND A HALF HOURS!

Apple, you need to put more engineering resources into this sort of thing. The scale you are dealing with on the iPhone and the iTunes Store and now the App Store is way beyond what .mac ever was. You need to THINK DIFFERENT!

Building Team Cohesion Quickly

When forming a new team to build that Killer Web App ™ it is very important that the team work as a cohesive unit. Much has been written about how to build a collective team spirit and I won’t rehash that here. Sufice to say, if you don’t have a cohesive team you probably won’t be able to execute on your grand ideas and the project will eventually fail.

Today on TechCrunch there was a terrific article that details how one group of like-minded individuals came together to build a web application in a few days for a meer $10,000. Check it out.