Are you one of the many devs who miss Xcode's "Fix and Continue" feature? Apple removed "Fix and Continue" in Xcode 4. This option allowed you to patch your binary with updated code, as you ran and debugged it.
Well, there's good news. Developer John Holdsworth has released Injection for Xcode. It's an OS X application that lets you inject those same code changes into running applications for development and debugging. It works with both OS X and iOS apps, including those running on devices.
It works by allowing your classes to be recompiled selectively as class categories. These are loaded at run time via bundles, and override your originally compiled code. So you can modify, enhance, and adapt your code during run time and tweak elements on the go.
Holdsworth has been working with this feature for quite a long time. He writes:
In London there were two banks which embraced NeXT for developing front office trading systems in an age before even windows 3.1. The hardware was only just up to it however and build times where at three quarters of an hour so we started using this means of patching the app using bundles rather having to relink the whole thing.
I asked him to fill in some of his background about working with Apple and NeXT technology. He responded:
I first encountered NeXT in 1989 at IRCAM the computer/music research institute in Paris where I fell in love with Objective-C. It's great to see things coming full circle with all this memory managed stuff, and C++, such a half baked language falling away.
How ironic that it should be a mobile device which paved the way. If you ask me the closest we've been to Object-Oriented Nirvana is Smalltalk, and Objective-C is pretty close to that.
Steve visited one day spinning the reality distortion field about the new "autorelease" mechanism. Quite the mystic.
My only other claim to fame was when the Apple purchase of NeXT came through I sent him an email enthusing greatly and got a reply saying "Thanks John, a Merry Christmas to you and your family."
Been a disciple ever since. Shame I didn't buy the stock.
Unfortunately, Apple has been a bit squirrelly about letting Injection into the OS. Holdsworth first hoped to start selling Injection on the Mac App Store back in February. Apple has been sitting on the app for months, failing to give it a thumbs up or down.
Do you want to help out? Drop Apple a note at email@example.com and ask them to expedite approval on Injection for Xcode (App number #id498448895).
Until then, Injection for Xcode is available on Holdsworth's personal site. It offers a two-week trial period and costs US$9.99 (individual license) or $25.00 (corporate) after that. Licenses are issued per-machine.
To purchase, the app guides you through PayPal (via a web view) after the trial period.