Monthly Archives: July 2010

iPhone Utilities for your Mac or PC

I stumbled upon a couple of really good iPhone utilities for the Mac and PC from MacroplantiPhone Explorer and Phone Disk.  These apps allow you to see what is on your iPhone, iPod Touch, or iPad – pretty cool.  They’re not quite as useful if the device isn’t jail-broken, but they’re still useful.

iPhoneExplorer PhoneDisk

For example, they will both allow you view the app and media files that are on your device.  They both allow you to copy files to and from your device as well.  iPhone Explorer allows you to see all the files related to your apps as well while Phone Disk allows you to delete files on your device.  iPhone Explorer provides a custom UI for viewing the contents whereas Phone Disk mounts the device as a disk, just like a USB flash drive.

Macroplant provides iPhone Explorer free of charge, while normally they charge for Phone Disk.  Until December 2010, however, they are offering it for free.

Resources

Adding a separator to the Mac OS X Dock

I’m now developing iPhone apps at work which means developing on a Mac.  It’s quite a shift from Windows, so I’ve been spending time learning the ins and outs to become comfortable with the platform.

One of the things I discovered is that the Dock doesn’t provide a way in the UI to add spacers (dividers) between application tiles.  There are two ways to do this.

Add a dummy application to the Dock

This solution is really simple. Brandon Kelly wrote a very simple application Dock Dividers.  Dock Dividers is simple a collection of do-nothing applications with an application image that looks like a divider.  All you do is simply drag an application to the place in the dock where you want a spacer.  The biggest issue is that you have to make sure you don’t drag the same application to the Dock more than once.

Dock Divider

Use the defaults program from Terminal to add a spacer

The Dock application actually does support the concept of a spacer tile.  Apple just chose not to expose it in the UI.  To add a spacer tile, type the following sequence of commands in a Terminal window:

defaults write com.apple.dock persistent-apps -array-add '{ "tile-type" = "spacer-tile"; }
killall Dock

You can add as many spacer tiles as you want.  Once you’re done adding them, execute the killall command to restart the Dock.

Dock Separator

To remove a spacer tile, simply drag it from the Dock, release it somewhere else, and watch it go up in a poof of smoke.

The biggest issue I see with this method is that the spacer tile is simply a space on the dock.  You don’t get to specify an image to make it look nicer.  Hmm… as I think about this, I’m sure there is a way.  Let me know if you figure it out.

Resources

Debugging .NET Web Services

I’ve been spending a lot of time lately debugging web services and I’ve been getting frustrated with the client timing out on me, so I finally buckled down and figured out how to prevent it.

Web Services consist of two parts – a client and a server.  The client is implemented as a class derived from System.Web.Services.Protocols.WebClientProtocol, e.g. through SoapHttpClientProtocol or HttpWebClientProtocol.

When a client calls a method on a web service, an asynchronous message is sent to the web service and the client waits for it to complete.  The client doesn’t wait forever, however.  The default timeout is 100 seconds (100,000 ms).  To change this, you must set the Timeout property on the web service client object, like so:

MyWebService client = new MyWebService();
client.Timeout = System.Threading.Timeout.Infinite;

The Timeout property contains a value representing the number of milliseconds to wait for calls to return before throwing a System.Net.WebException exception.  To prevent it from timing out altogether, specify either -1 or System.Threading.Timeout.Infinite.

Reources