Tech Thought

Tech tips, hints, and general musings. PHP, Perl, Mysql, Javascript, AJAX, JSON, Linux, Mac OSX

Entries for December, 2008

How-To: Jump between tabs using UITabBarController

Sometimes you want to jump between tabs in your iPhone app programatically (ie you don’t want the user to have to touch the tab prior to displaying it). This is very easy to achieve: self.tabBarController.selectedIndex = 3; Where selectedIndex reflects the tab you wish to select (from left to right, starting at 0 for the [...]

Comments (5)

How-To: Change text on Back Button in UINavigationBar (UINavigationController)

If you’re using a UINavigationController to control the navigation in your iPhone app, you’ll find that the “Back” button on your navigation stack can sometimes get very long – particularly if you have long titles for the views you push on to your UINavigationController stack. That’s where changing the text on the ‘Back’ button can [...]

Comments (4)

Visual Diff programs for Mac OS X

I find the very handy DiffMerge application perfect for providing a visual diff between two files in OS X. It provides command line support, along with side-by-side visual diff functionality, and best of all – it’s free!

Leave a Comment

How-To: Create UIActivityIndicator in iPhone NavigationBar (UINavigationBar)

This is a simple code snippet that can save you hours of mucking around trying to place your activity indicator (spinning icon) in the Navigation Bar of the iPhone.  This example assumes that your view controller has a property of type UIActivityIndicatorView called “self.activityIndicator”: // Create a ‘right hand button’ that is a activity Indicator [...]

Comments (8)

Fairfax Releases iPhone App: Fairfax Radio News

Fairfax today released a very handy iPhone App that provides you with the latest radio news on your iPhone.  Fairfax Radio News provides access to the most recently aired news broadcast from the Fairfax Radio network (which consists of 2UE, 3AW, 4PC, 6PR) direct to your iPhone. It turns out to be an amazingly useful [...]

Leave a Comment

Handy Google Adsense Dashboard widget for Mac OSX

I’m always logging in to Adsense to check how my balance is looking – but now I don’t have to, thanks to this handy dashboard widget for Google Adsense: Simply enter your Adwords Username and Password, and you can view your earnings for “Today”, “Yesterday”, “Last Week”, “This Month” and “Last Month”.  Very handy – [...]

Comments (1)

How-To: Show/sync volume control in iPhone SDK

Developing for the iPhone, we wanted to show a volume control that sync’ed with the user’s volume control buttons on the side of the phone.  It turns out, the best way to do this is to show the volume control using the MPVolumeView class (part of the MediaPlayer framework). Here is some example code from [...]

Comments (2)

How-To: Stop iPhone going into sleep mode (iPhone SDK)

The iPhone OS will attempt to save battery power by using its automatic sleep timing function. If the system doesn’t detect any ‘touches’ it will dim the screen and eventually turn it off. Sometimes you don’t want this to occur – if you are creating a game or application that uses the accelerometer for instance. [...]

Comments (1)

How-To: Fix ‘Verification Failed’ error (0xe8000001) iPhone Adhoc Distribution

I have had huge problems trying to provide my iPhone Applications to friends using the Adhoc Distribution method.  I thought I was following Apple’s instructions down to the letter: Obtain an Adhoc Distribution Provisioning Profile Install provisioning profile in XCode For my project, create a new build profile called “Adhoc Distribution” copied from the “Release” build [...]

Comments (7)

How-To: Convert a string to NSDate

In Objective-C, you commonly nead to convert a string to an NSDate object.  A simple way to do this is using the NSDateFormatter object.  It provides the dateFromString method which converts a string into an NSDate object.  You do, however, need to tell NSDateFormatter the format the date will be in.  See below example: NSDateFormatter [...]

Comments (4)