iPhone in Dock

Testing your iPhone application, you may at some point in time need to stub a method call whose return type is a boolean (or some scalar value, or C based structure). The way to implement this (as described in a discussion on CocoaDev here) is to wrap the boolean in an NSValue using the OCMOCK_VALUE() macro defined in OCMockRecorder.h.

While this solution technically works, I find that doing this within the test class itself makes the test cases a little less readable along the way. Instead, I found it useful to extend OCMock to do this type of conversion for me, keeping my test code a bit cleaner as a result.

Let’s take a look at an example by examining the set up for a simple test case..


book cover

In Core Animation for Mac OS X and the iPhone, Bill Dudney gives a good introduction to the Core Animation framework and some of the slick ways that you can spice up a Cocoa app for Mac OSX or the iPhone. Its assumed that you know your way around Xcode, and that you know the basics of Cocoa programming. So if you are new to Cocoa you may want to have a copy of Cocoa Programming for Mac OS X handy, but you can get your hands on the code examples from Pragmatic Screencasts if you want to try and work your way through it.

The book gives a fair overview of the Core Animation framework, and helps to get you through some of the less intuitive parts. It quickly walks you through a few different examples of developing animation apps for the mac and then explains the differences and limitations of writing for the iPhone. I would also suggest reading through the apple docs which will help you understand some of the other tools available to you and also read more details on what you are working with.

Its a quick read, coming in at only 200 pages, and a lot of those pages are full-page images. Personally, I was hoping for a more thorough review and examples for the iPhone, and was dissapointed that there are only like 14 pages in the iPhone chapter, and 7 of them are a full page of a single image. (I think that might have something to do with the time the book was written and the state of the NDA for iPhone developers, but still I was disappointed).  You can get the pdf directly from the PragmaticProgrammers site, but you might want to check Amazon too.

Overall, I think the book gives a decent start to some animation concepts, and ways to improve your iPhone apps, but you might want to hold off on getting it now, and work your way through the existing docs and other sites first. I suspect the next generation of docs on this topic will have a much deeper review and will be worth the wait.

Now I’m looking for something that can give me a good overview of using OpenGL for the iPhone or something like Blender or Unity3d.

Related Services: iPhone Application Development, Custom Software Development

jQuery logo

I’m as geeked about jQuery’s 1.3 release as the next developer. But I’m even more excited about the new API browser developed by Remy Sharp and available here.

For as long as I’ve been a jQuery user – going on 18 months now – I’ve been frustrated by the slow speed and sometimes intermittent availability of the jQuery documentation site. Now we’ve got a blazing-fast API browser that presents jQuery Core and jQuery UI side by side in the same cool interface. Better yet, it’s available as an Adobe AIR app for offline viewing. Sweet!

I could quibble about the lack of bookmarkable URLs and the occasionally sparse documentation of corner cases. Instead, I’ll just remain upbeat about this huge step in the right direction. No matter how intuitive jQuery’s API, it’s a powerful library whose roster of methods continues to grow. Nothing speeds up development faster than quick, persistent access to quality API documentation.

jQuery logo

jQuery celebrated its third birthday Wednesday with the release of the brand-new 1.3 version. This latest release includes a bunch of cool new stuff which has already been discussed to death elsewhere. To me, however, the most interesting aspect of jQuery 1.3 is the movement of former plugin functionality to the core library.

Live events are a new twist on the venerable, and indispensable, Live Query plugin, while the upgraded, more granular effects queues were previously tackled by add-on authors. IMHO, this kind of migration is A Good Thing, providing greater parity with other core JavaScript and effects libraries (such as Scriptaculous’s FX queue) while offering compelling feature differentiation (event binding throughout the full lifecycle of an Ajax page).

Over at the Rails Prescriptions blog, I’m going to be posting a series of interviews with various and sundry Rails folks — I’m cross-posting the first one here. To get the series started off, I’ve decided to use myself as a guinea pig and see if I can hold up to the grilling.

A couple of quick notes before I get to it.

  • The free e-book Getting Started With Rails Testing is now available. Check it out.
  • Those of you lucky enough to be in the sub-zero Chicago area can come to the Chicago meetup Saturday, January 17th to hear lots of interesting stuff, including me talking about testing and Rails some more.

And on with the interview.

I’ve used the ILog Business Rules products on a number of projects. Reasonable software. Does the job. Not exactly cheap. I’m not sure why they went for the aquisition by IBM — it was announced back at the end of July, so likely nothing to do with hard economic times.

What does this mean for software developers and system integrators? Back when the aquisition plans were first announced, I joked that we would soon be using WebSphere rules. And wouldn’t you know it, the aquisition announcement mentions ILog and WebSphere in the same sentence several times.



I’m pleased to announce that the getting started guide, conveniently titled “Getting Started With Rails Testing” is now available for download at the Rails Prescriptions site.

It grew to be a bit longer than I originally intended, but I’m very happy with how it turned out. It starts with an empty Rails application and walks through the first couple of feature additions, adding tests for controllers, models, views, and basic security.

Download, read, enjoy, tell all your friends, let me know what you think.

My most recent Pathfinder project calls for a pretty typical Ruby on Rails web application with two interesting additional components: a Facebook application and an iGoogle gadget. Though a Rails Facebook plugin was easy to find, Rails development tools for iGoogle weren’t as thick on the ground.

First, a bit of background: iGoogle, Google’s personalized-homepage service, offers developers two methods of application development:

  • build a native gadget by wrapping custom HTML, CSS and JavaScript in an XML wrapper.
  • build a sandboxed gadget by wrapping an externally hosted web application in an iframe.

Because of cross-domain security issues, gadgets that require authentication must be built using the iframe sandbox method. As it turns out, this method’s a lot easier. Instead of building a whole new interface, you can just tart up your existing app with an iGoogle-optimized user interface. Why replicate your existing view logic with a bunch of iGoogle-specific JavaScript when you can just reskin and call it a day?

As it turns out, though, reskinning a Rails app for iGoogle isn’t as simple as it might seem at first glance. I can think of three options. All have drawbacks:


Here’s a quick rundown of how I was able to generate a gem from scratch and release it using github. There are 2 gems that are most commonly used for writing new gems: newgem and hoe. The pros/cons of these 2 gems could be another blog post, I recommend newgem for starters.

I’ll be doing a talk on Getting Started With Rails Testing and/or related testing topics this Saturday, January 17th at the monthly meeting of

It’s at 3pm, location and other information is available at their site.

Looking forward to it — see you there!