Archive for 'Programming'


Here’s a handy little tool to add to your bag of iPhone programming tricks: iPhoneSimulatorExchange! What it’s for is to — wait for it — exchange iPhone Simulator binaries, eponymously enough:

Create 1-click installers of your iPhone Simulator apps to share with other developers for testing. Or to send it to someone to create Screencasts for reviews.

There’s actually been a good number of times when we just wanted a client’s feedback on a proposed workflow or the like and we’d wished that there was a way to get something quickly without the whole send me your device ID let me issue a new provisioning certificate now try and get iTunes to recognize it yadayadayada. And especially when we needed something signed off on by someone who doesn’t actually have an iPhone at all. Yes, that happens. But finding any old Mac to install the SDK on, now that’s a great deal less of a burden! So we’re quite looking forward to using this. It seems brain dead simple, start it up and it shows the apps installed in your simulator,


then just click the ‘Build Installer’ button and it creates a one-click installer with your splash screen, like


Double-click that, and it proceeds to install itself. Could it get any simpler? We think not. Yes, we can see this making working with clients a good deal less hassle, indeed. Much thanks to these GrandTotal fellows for this!

Continue Reading →

Outsourcing testing

Here’s a service to be aware of if you’re doing some desktop Mac development and need a beta tester pool, or if you’re the kind of user that glees in poking around in buggy prerelease software:, from the same people who run the most excellent prMac press release service for your Mac and iPhone press release needs. And what is exactly, you ask?

MacDeveloper is an opt-in service for testers who love what the Mac community offers and genuinely want to test. We feel the platform is an excellent alternative to Bundled software avenues. At the same time a developer’s software is being tested, they’re also giving back to the community who supports them.

MacDeveloper makes it fun for Beta Testers. Register to test your favorite software and receive coupons for FREE software, or purchase software at huge discounts.

MacDeveloper for Testers

   * Register and Test software absolutely free

   * Choose only the Software Categories that interest you

   * Earn Points for Testing your favorite Software

   * Use points to purchase software for FREE

   * Use points to purchase software for huge discounts

   * Earn valuable Star Ratings for being a Quality Tester

MacDeveloper for Developers

   * Create Project Channels for only $18.75

   * Upload as many binaries to Project Channels as you wish

   * Search the Beta Pool for Quality Testers

   * Find Beta Testers who genuinely have a desire to test

   * Use Coupons for Testers to purchase your Applications for free or at a discount

   * Excellent method for customer building

We haven’t happened to use it ourselves yet, but if one was to be looking for something a bit more structured than a public beta but didn’t have an inhouse QA staff or the budget for hiring out, this certainly does look like something worth giving a shot; there seems to be a pretty good selection of happy users, anyways, so apparently it works out pretty good for at least some people.

Of course, if even this much effort in beta testing strikes you as too much, there’s always the ‘call the first build that doesn’t burst into flames at launch the “Preview Edition” and start charging for it’ strategy…

Continue Reading →

Library: boost for iPhone

Here’s a handy link if you have any boost-using code you need to port over to the iPhone … well, if you want to use anywhere, actually; coding maven Jeff Koftinoff has released a streamlined version called jdksboost:

This version only changes minimal source code from the boost trunk. The objective of the changes to boost is purely to re-arrange the source files so that a simpler build system can be used…

The current standard for building the library files for boost involves a build tool called bjam which is powerful but not easily integrated into the other build environments that I needed.

I decided that for some tools, like Microsoft Visual Studio and iphone and Mac OS X leopard, I really needed all of boost to be compiled by the same IDE project management tool so that I could make sure that all the various compile and linker options were applied correctly between the libraries and my main project…

Useful by itself no matter where you’re using this; and for iPhone developers in particular,

  • Apple iPhone targets are supported with an XCode 3.1.3 static library target.
  • Endian and long double changes to boost to allow compilation for iPhone hardware as well as the iPhone simulator target.

So there you go, grab the source and enjoy!

Continue Reading →

Source: World Challenge

Now here’s something we’d sorta been pondering ourselves might be worth doing; this fellow’s taken the GPL’d crossplatform game Tux Racer and ported it to the iPhone


… for $3.99. Whilst providing a desktop build for free, and source downloads at the bottom of the product page which apparently this fellow feels meet the terms of the GPLv2 sufficiently.

We say “apparently”, because there is a body of opinion out there that since the casual consumer cannot edit the source code to an App Store-bought application and run the edited program directly on their phone, it is impossible to comply with the terms of the GPL with an application distributed through the App Store. We don’t subscribe to that personally, mind you; first off, nowhere in GPLv2 does it explicitly state that you must be able to run it on the distributed device — so being able to run your modified code in the simulator, which requires nothing but the freely downloadable Xcode toolchain, arguably satisfies the license adequately. And even if you do insist that the terms implicitly require that you run the modified version on the distributed device, then we don’t think that the $99/year developer program fee to Apple to be able to run whatever source you like on your phone is a condition that amounts to a GPL violation, any more than needing to buy a commercial compiler to do something useful with any desktop GPL’d source would violate it. But as the Free Software community is disproportionately populated with Apple-haters, mere logic is not always sufficient to appease them; and as this (to our knowledge) is the first GPL-licensed iPhone program that anyone has attempted to charge money for, if there is anyone out there willing to test their anti-iPhone interpretation of the GPL in court, well, this is whom they’d probably pick for a test case.

So we’ll be watching to see if any of the huffers and puffers get all indignant about this fellow’s entrepreneurial bent; and if not, we’ll probably look for some GPL’d game to port ourselves, as we would rather like to have an open source iPhone project to direct those who would like to see some demonstration of our coding practices to, and hey if it might make a buck or two that’s always great as well! In the meantime, if you’re a desktop Tux Racer fan, and not a programmer yourself — buy it to encourage more GPL’d source ports!

World Challenge

Colophon:Well, today was to be the final client-provided post of The Great WordPress Client Test, finishing up with über-text-editor


TextMate 1.5.8!

but the actual testing ends up a DNF, as we couldn’t be bothered actually getting TextMate to work. See, its blogging extension’s bundle’s idea of configuration is to have you put your blog’s XMLRPC address in a text file. We gave it a couple tries at what we think that address should be for this blog, but it failed to make them work. And we figured we just wouldn’t bother to keep trying, since obviously there wasn’t going to be any useful conveniences here at all, so at best it would make it into the same class as the other non-WYSIWIG tools. So we’ll award it 2/10 to put it at the bottom of our ratings due to its completely beyond the pale requirement of “needing a clue about blog internals” and leave it at that.

Continue Reading →

Source: SonoDraw

If you happen to be doing any desktop Cocoa programming that involves vector graphics, an excellent place to start from is GCDrawKit, part of the open source collection of Graham Cox. Chances are if you’ve looked for anything of that sort you’ve found it on your own already, but here’s something new: full source code to a CAD application using it!

I thought that people might be interested in the source code for the latest build of our in-house CAD application SonoDraw. A full source bundle, including all supporting frameworks, can be downloaded from here:

This version finally integrates work that Allan Daly and Michael Caron have done on the DXFReader framework and its connection to DrawKit.

Peruse the announcement thread on the DrawKit mailing list, and enjoy!


Yes, we’re over halfway now in The Great WordPress Client Test, and today’s victim is:


myWeblog 2.1!

Unfortunately, this one pretty much falls into the same category as MarsEdit; HTML editing only, no convenient rich text editing. And it’s not quite as polished as MarsEdit either. On the upside, it is much more focused directly on WordPress than anything else so far — particularly, this is the only tool (we think) that has support for WordPress pages as well as blog entries. Of course, we’re not actually using WordPress as a CMS so that’s not a compelling feature at the moment, but if we ever do get around to it we will *definitely* give myWeblog another goaround, since HTML-only editing would be ok for pages that we actually do want to craft in some detail, as opposed to our usual strategy of just throwing up something that we might want to search for later. In the meantime … we’ll give it a 6/10 tie with MarsEdit for the ‘semi-casual blogging’ problem space.

Continue Reading →

Accelerometer Simulator

What’s the biggest annoyance about iPhone programming in the simulator? Well, if you’ve written any programs that use the accelerometer, we’ll just bet that you’ll put “accelerometer doesn’t work in the simulator” right at the top of your list. But ho! Here is how you fix that!

Accelerometer Simulator is an iPhone/iPod Touch application that transfers accelerometer data from the device to your computer using UDP protocol.

The main use case for the application is to allow iPhone application developers to create applications that require accelerometer, without having to do all the debugging on the actual device. By inserting two files into their project, they can use the Accelerometer Simulator to provide accelerometer data to their application when debugging on the iPhone simulator…

Nothing special about the simulator, mind you, this code could also be applied to sending realtime data from an iPhone app to any other desktop app. Which has some intriguing possibilities. In the meantime, grab the project from Google Code, and using it really couldn’t be any simpler:

To embed Accelerometer Simulator capabilities into your own application, simply add the AccelerometerSimulation.h and AccelerometerSimulation.m files from the Simulator classes directory into your project. Then in the source file where you configure UIAccelerometer, simply add

#import “AccelerometerSimulation.h”

This will override the default behaviour of UIAccelerometer when run on the iPhone simulator. When building for device, nothing is changed in your application.

And note also this extension which lets you use your MacBook’s accelerometer to provide the data. Not that we can really think of an actual compelling use case for that … but hey, it’s a nifty hack, and who doesn’t love nifty hacks?

h/t: If ( … ) then { … }!


And it’s day 4 of The Great WordPress Client Test, and today we’re using:


MarsEdit 2.3.2!

Now this is a right switchup from yesterday, when we ran screaming from MacJournal because it doesn’t have a HTML editing view; today we’re tossing MarsEdit out of serious contention because it doesn’t have a WYSIWIG view. Yes, the live preview is excellent, and yes the immediate image uploading is well done, and there’s lots of other good things about it … but although we want optional control over all our HTML, we’re not interested in mandatory control, that’s just too much effort. So we’ll give MarsEdit a 6/10 for being a very nice tool indeed if you do want complete control, but being unduly complicated for semi-casual blogging like ours. Yes, we’re hard to please, we know. Just call us Goldilocks.

Continue Reading →

Advertising: AdMob v. AdWhirl

So we really haven’t gotten into the advertising side of iPhone programming that much, aside from casually noting a few links, but we’re starting to notice that some people are doing better at it than actually selling their programs. At least, there’s enough money in it now for people to FIGHT! So break out the popcorn and follow along with the developing Clash of the Juggernauts!

Juggernaut A in this case is AdMob, which it seems is the current biggest ad server in the mobile space, and Juggernaut B is AdWhirl, which makes a pretty compelling case to sign up with it by acting as a mediation layer instead of a direct provider. This did not go over well with Juggernaut A, so they decided to take their toys home with them:

Beginning July 22, AdMob will no longer serve ads requested from iPhone apps that employ ad network mediation layers such as AdWhirl or Tapjoy. This change will enable us to provide our publishers and advertisers, as well as end users, with the best possible experience and results…

Yeah, sure. We were raised on a dairy farm, so we know exactly what we’re smelling here. And so do most others; the discussion on the iphonesb list was … spirited, with threads like Who hates AdMob today? Hard to miss that sentiment, indeed. However, as you can see in the admob blocked adwhirl, now what? thread, Admob does indeed generally make up the bulk of revenues. Which is why, as this particularly perspicuous post portrays,

My theory goes as such: AdMob is frightened. They have a dominant position, but suddenly an influx of competitors has put the heat on 
them. I mean, frickin’ 800-pounds-ads-gorilla Google is getting into the game. And AdWhirl allows them to switch at a moment’s notice.
So, they make the decision to “balkanize” the target: “with us or against us”. They say: if we stop serving ads to AdWhirl now, when competitors can’t match our inventory and payouts, the large number of people having us as a primary revenue stream will have to switch to the AdMob SDK or lose us as a revenue stream. Makes sense in context.
Of course, this situation is not going to last. Competitors will eventually start to catch up to AdMob (I mean, frickin’ Google). And AdWhirl is a mid-to-long-term competitive advantage too large to drop…

Yep, we’d agree with that. There’s lots of other good insight in that thread worth checking out, too, but you get the gist of it.

Also note the thread My E-mail to AdMob about the adwhirl isssue, which sideslips into a discussion of new ad player MdotM, in which the founder shows up to fill in some background on it; and some more hard numbers on advertising return for your consideration in that thread as well.

And finally, if you haven’t come to a firm conclusion about which direction to take your ad-supported iPhone programming yet, then read this last thread, Thanks for all the support – AdWhirl, from one of the AdWhirl cofounders:

In terms of updates, we’ve been in communications with AdMob and the big requirement for them was not that developers couldn’t use both AdWhirl and AdMob, but rather, since they couldn’t tell when a developer was using AdWhirl to cycle through AdMob ads (since we requested directly from the library), they had to ban anyone using AdWhirl. That was why, after talking to them, we immediately pumped out a new version of the library that pulled AdMob’s SDK out, and differentiated our ads from AdMob’s ads. Developers can now safely implement both AdMob and AdWhirl with their own logic, but of course AdWhirl has no visibility into what is happening with AdMob and can’t help facilitate any optimization, customization, or ad tracking. (our blog post about this is here:
Keep in mind, though, AdWhirl isn’t just about maximizing revenue and optimizing fill-rates (although we do that, too!) – we allow developers to create their own custom ads dynamically (both icon+text as well as full-width banner images) and link to wherever they’d like to. We realize other ad networks / companies will soon be following suit with their own house-ads products, but keep in mind that, as an OPEN PLATFORM, AdWhirl is planning to open up our community of over 1000 publishers across over 1500 apps, such that you guys can soon start helping one another directly with cross-promotion and getting apps past the top 100 without paying several thousand dollars to an ad network. There’s value in this community as you guys have clearly known for awhile!
Plus, we’re going to be offering new ways to monetize soon that break the whole advertising paradigm.
The important thing is we’ve worked really hard to make sure you guys aren’t forced to make a choice, which is what our open platform is all about.

Well, we know who we’re going to bet on as the long term iPhone advertising success story here!


For day 3 of The Great WordPress Client Test, our post is courtesy of


MacJournal 5.1.3!

This one, well … it’s not called “MacBlog”, you may notice — and that is for good reason. Although I suppose this “journal” concept must appeal to some not insignificant body of people or else it wouldn’t be into version 5, it’s just not designed as a blog management tool. So there’s really no point listing specific issues with WordPress, we’ll just jump straight to the conclusion of “pick something else” and give it a 3/10 for getting a post up with a picture, although we had to sort out a really annoying amount of formatting and metadata afterwards, and HTML editing is just not available!, which puts MacJournal right off the WordPress coder geek reservation far as we’re concerned.

Continue Reading →

Snippet: Intercepting Touches

Ever wanted to intercept touches on a view that generally eats them, like MKMapView for instance?

I’d like to allow my user to double-tap the map view to place an annotation marker, rather than the default zoom behaviour. What’s the preferred method of having my program intercept touch events, then either passing them along (single-touch) or not (double-tap)?

Well, here’s a question on Stack Overflow that answers that for MKMapView and probably UIWebView as well: create a wrapper view that intercepts the various touch events, then place the functional view inside it, like this:

#import <MapKit/MapKit.h>
- (void)applicationDidFinishLaunching:(UIApplication *)application {

//We create a view wich will catch Events as they occured and Log them in the Console
viewTouch = [[UIViewTouch alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];

//Next we create the MKMapView object, which will be added as a subview of viewTouch
mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[viewTouch addSubview:mapView];

//And we display everything!
[window addSubview:viewTouch];
[window makeKeyAndVisible];


Second day of The Great WordPress Client Test, and today we’re checking out


ecto 3.0!

Now this acts much more like a Mac program should. Interface is intuitive, category/tag/image composition beats Blogo all hollow, we like that ‘Amazon Helper’ plugin idea, … but there’s some quibbles here too:

  • The Preview window is resolutely blank. Blogo, now, it did a nice job of downloading all the appropriate templates from the blog. On the other hand, ecto actually uploaded it as expected and didn’t muck up the categories or lose text and so on … so we don’t count that as a major flaw.
  • Doesn’t seem to be a way to blockquote selected text, you have to click into blockquote mode then paste apparently. Not a dealbreaker I suppose, but I do rather like the online editor’s behavior that blockquotes the paragraph containing the insertion point.
  • It doesn’t maintain the Undo stack between HTML/text view changes either, even if you don’t actually do anything but switch between the two views.
  • Whilst in general the HTML creation and paste handling is excellent, and it’s a brilliant feature to actually force the HTML to be correct before leaving the HTML editor and offer to fix it for you like ecto does … in the particular circumstance where we’d like to paste source code in and slap <pre> tags around it, this feature actually gets in your way as it insists on making every line a new paragraph, which is not what we want as it loses the indentation. Perchance there’s a way around this, but it’s not immediately obvious.
  • The initial publish disallowed trackbacks/pingbacks. Presumably that’s a trivial setting fix somewhere, but allowing them really should be the default we think…

So yeah, we like this ecto thing overall, we’ll give it a solid eight from first impressions. Definitely worth an indepth evaluation probably … but we’ll see if we’re completely starstruck by any of the remaining five!

Continue Reading →

Code: Plausible Blocks

So you’re all pumped up about this deft-sounding “Block” (aka Closure) concept that Grand Central Dispatch is going to bring to us in Snow Leopard … but it’s not out yet, and Snow Leopard does not run on the iPhone! So what do you do?

Well, if you’re really excited, you … implement it yourself.

If you caught the sessions on blocks at WWDC, you may be as excited as
I am to make use of them. Unfortunately, they’re only available for
Snow Leopard.

As a result, I decided to back-port block support to iPhoneOS 3.0 and
Mac OS X 10.5…

Dude. That’s hardcore. Here’s the announcement of Plausible Blocks; project page on Google Code; and a tutorial demonstrating its use with NSOperationQueue and UIActionSheet with sample code on github. Enjoy!

UPDATE — More good posts on blocks:

Using Blocks: Understanding the Memory Management Rules

Blocks, Episode 1

Blocks, Episode 2: Life Cycles

UPDATE 2 — Recommendations from the 1.0 release announcement:

Joachim Bengtsson’s Programming with C Blocks

Mike Ash’s Series on Blocks, Part I

Mike Ash’s Series on Blocks, Part II

Landon Fuller’s Using Blocks 1 (as mentioned above)

Landon Fuller’s Using Blocks 2

Google Code Project FAQ

h/t: iPhoneSDK!

Continue Reading →
Page 79 of 99 «...5060707778798081...»