Mounting sparsebundle 03 Jan 19:45

If you've ever wanted to mount your remote Time Machine backup sparsebundle disk image, but always wind up with "operation not supported on socket", try this:

  1. Open a terminal
  2. cd /Volumes/yourphysicaldisk
  3. chown -R $USER: yoursparsebundle.sparsebundle/
  4. chmod -R u+rw yoursparsebundle.sparsebundle
  5. chmod u+rw .02fa8s83yourdiskid
  6. hdiutil attach -noautofsck -noverify yoursparsebundle.sparsebundle

If your intention is to nuke your old backups completely (to start over from scratch), you'll find it much, much faster to use Disk Utility to "erase" the volume once you have it mounted, rather than using the excruciatingly slow finder delete process.

PragProg iPhone dev book 02 Jan 15:28

The verdict is in: "iPhone SDK Development" is the best iPhone title available today.  Targeted at the developer new to the SDK, and possibly Apple developer tools as well, this book far outshines the others I've noted. It's very clear, very concise, and builds nicely from square 1 up to a fairly complicated example application, with many interesting (and useful) side-trips along the way.

If you're just getting started, or thinking of getting started in iPhone development, this book will save you enormous amounts of time, energy and googling.  Get It now.

.hgignore file for xcode projects 29 Dec 19:00

XCode produces much build-related junk. If you use the exceedingly excellent Mercurial, you can stick the below into your .hgignore file and ignore said junk in one fell swoop.

syntax: glob
            .DS_Store
            *.swp
            *~.nib
            build
            *.pbxuser
            *.perspective
            *.perspectivev3
            *~
            

Enjoy.

UI Control wiring Helper 28 Dec 18:56

Stick macro in a header file #include'd in your unit tests, and you'll be able to test that your views, controls and actions are wired appropriately in IB:

#define LSAssertThatSControlIsWiredTo(control, action, vc, evt) \ do {\ @try{ \ STAssertNotNULL(vc, @"View Controller was nil?"); \ STAssertNotNULL(control, @"Control was nil?"); \ STAssertNotNULL(action, @"Action was nil?"); \ NSArray *actions = [control actionsForTarget: vc forControlEvent: (int) evt]; \ STAssertTrue([actions containsObject: action], @"could not find wiring!"); \ [actions release]; \ }@catch (NSException *e) { \ @throw e; \ } \ } while(0);

This assumes you're using the GTM Toolkit (to get the STAsserts).

The iPhone™ Developer's Cookbook: Building Applications with the iPhone SDK 24 Dec 18:15

This book, in a departure from the previous wretched iPhone title, is actually useful, current, not padded with source listings, and quite easy to read.

Presented in cookbook form, each recipe demonstrates an essential technique or two, and would be a valuable addition to any budding iPhone developer's bookshelf.  Experienced iPhone hackers will find it rather light reading, though they are clearly  not the target audience.

So far, the best iPhone development book I've come across. Available on Safari, or in dead-tree form.

RulerPhone 23 Dec 15:55

Neat.  Came across this trying to think of interesting ways to use the accelerometer.

ReCAPTCHA in the news 08 Dec 16:52

It seems ReCAPTCHA is going strong still.

By the way, I wrote the Ruby gem version of it. you can find it here.

ruby libplist 21 Nov 17:20

If you want to write a REST webservice for use by the iPhone but not muck around too much with XML, you could do worse than libplist.

In a Rails application, all one has to do is mix in the Plist::Emitter into the model, then wrangle whatever attributes you want to render into a type understood by the plist emitter (arrays, hashes etc, see docs) thusly:

  def index
                render :xml=>@landlord.payments.map { |x| 
                  {:id=>x.id,
                   :amount=>"$%.2f"% x.amount,
                   :date=>x.created_at
                  }   
            
                }.to_plist
             
            

If you don't munge the types (the printf segment is just munging for a float, which plist doesn't handle well), plist will call Marshal.dump and stick the bytes into a <data> element in the plist, which is probably not what you want.

The iPhone's NSPropertyListSerialization knows how to turn a plist back into a native container type.

iPhone SDK Application Development, 1st Edition 21 Nov 15:57

If you ever get the chance to purchase iPhone SDK Application Development, 1st Edition, do yourself a favor and skip it.

I know a thing or two about Cocoa and Objective-C, I've read the incredibly excellent Hillegass book, I know a thing or two about iPhone development. Even with all these advantages, this book remained distinctly useless.

Poorly written, seemingly from the time before InterfaceBuilder supported UIKit, this book is little more than a repackaging of the high-points of the SDK documentation. There are many, many pages that simply regurgitate the SDK docs, the sample code is not particularly elucidating.

It is in rough-cut status it's true, but word on the blog is that the book is now complete. I can't see how any amount of editing will save it.

Peter Schiff 14 Nov 05:40

Peter Schiff was right about 2008-9... in 2006.  

It's nearly shocking to see him nearly laughed off the air by the likes of Ben Stein (almost as shocking as seeing a Visine pitchman being taken seriously).  The schadenfreude in the clip peaks as the gang of idiots at FNC gives slobbering buy recommendations to Bear Stearns ("like finding Dolce & Gabbana on sale"), Goldman Sachs,  and WAMU.

To be fair, it's standard operating procedure to have at least one talking head gibber about some impending financial apocalypse at any given point in time, no matter what the situation, so the broken clock  phenomenon may be in play.

Cucumber? 10 Nov 04:15

huh. Cucumber?

New Blog 09 Nov 18:28

So I got a little bored and wrote a blogging application. Not bad for a day's work.

I've decided I'm now a fan of partial layouts, and probably colorblind, or possibly just tasteless.

The WYM Editor is neat by the way.

You'll note there's a bunch of stuff missing, and the occasional busted feature. This will change.

© 2008 LoonSoft LLC All rights reserved.