Tech Thought

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

Entries for the ‘Tech’ Category

How-To: Check root DNS settings for domain

Using “dig” you can determine what IP address or CNAME your domain is pointing to quite easily. However what I didn’t know was that you can actually check what the root server thinks your domain is pointing at, so you can check if its set correctly when you are migrating to a new IP address. [...]

Leave a Comment

What does iPhone OS 3.0 Mean for your Apps?

Recently I was involved in a podcast regarding the iPhone OS 3.0 upgrade. We looked at all the new features (and some upcoming ones in v3.1) and discussed how they relate to new features clients can develop in their apps. You can hear more here: What does iPhone OS 3.0 Mean for Your Apps (WSP [...]

Leave a Comment

iPhone UIScrollView with UIImageView have issues Interface Builder

Ever wanted to have an image view in a scrollview? Sure, you could directly add it using code, but wouldn’t it be nice to do it in Interface Builder? If you’re like me, you like to leave on the defaults unless absolutely necessary. I had an issue where I added an image view to the [...]

Leave a Comment

iPhone: Bugged UINavigationController? View doesn’t Scroll.

Developing a networked iPhone application, I had two views that were very similar – so similar in fact that they were copies of one-another with “Sending” renamed to “Receiving”. The idea was to get them both working with different XIB files, and then modify them. The code to load the sending view (from the main [...]

Leave a Comment

BudTrap: An easy way to solve iPhone/iPod headphone tangles

The guys at BudTrap have a great idea.  Create a device, which clips into your iPhone/iPod, stops your headphone getting tangled, and costs just $5 – with $1 being donated to charity.  On top of which, you get 5 additional “buddy” devices which you can share with your friends. They are also into working out [...]

Leave a Comment

How-To: Make UIWebView transparent

Common problem, need to apply nice HTML formatting for a section of your page, but want the UIWebView not to appear as a big white box – only the content of the UIWebView to appear. How to do it? myWebView.opaque = NO; myWebView.backgroundColor = [UIColor clearColor]; [myWebView loadHTMLString: @"<html><body style='background-color: transparent'> Content Here</body></html>" baseURL:nil]; The above [...]

Comments (2)

How-To: URL Encode NSString in Objective-C

It’s very easy to URL Encode an NSString in Objective-C (i.e. make a string safe to send using a GET request).  Simply do this: NSString* escapedUrlString = [unescapedString stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding]; Then just use the escapedUrlString in your NSURL object and you’re on your way.

Comments (5)

WSDL WebServices for Salesforce using PHP

I’ve found developing for Salesforce with PHP to be somewhat of an undocumented nightmare.  However, there are a few useful blog posts around that can make life easier.  One is here, which takes you through creating a webservice on Salesforce and then accessing it via PHP calls (yes – an end-to-end example!  hooray!) – thanks [...]

Comments (1)

Objective-C: Calculating Days, Minutes, Hours from seconds

If you need to convert a total number of seconds into specific components (days, hours, minutes and seconds) in Objective-C, you can use this code snippet.  You can probably do this a million other ways, but this works beautifully for me:     NSNumber *valueForDisplay = [NSNumber numberWithDouble: [self valueForDisplay:clockName]];     NSNumber *totalDays = [NSNumber numberWithDouble: [...]

Comments (5)

How-To: Add subdirectories to your iPhone Application

I battled with this for quite sometime without realising how simple the solution to the problem is. I wanted to have my complex app resource directory structure replicated in the “Resources” directory of my app – so that all my images, sound files and html files were stored in logical locations – except they always [...]

Comments (1)

Bagpipes on your iPhone: iPiper

WSP Online Solutions released iPiper yesterday, an iPhone app that allows you to play the highland bagpipes on your iPhone.  It was released just in time to play Auld Lang Syne as the clock strikes midnight on New Years Eve. The app provides the ability to play nine of the notes on the bagpipe, along [...]

Comments (2)

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

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)

EIATRACK launches iPhone Application

EIATRACK today launched an iPhone application to compliment their subscription web service. The iPhone Application provides subscribers with the following features on their iPhone: Reg Alerts Special Reports Subject and Substance Reports Events The application is a free download from all users and can be accessed from the iTunes App Store.  EIATRACK has further information [...]

Leave a Comment

iPhone Development: How to Stream Audio (mp3)

Okay, so we’ve fully taken the plunge and are now developing for the iPhone platform.  Its got a fantastic SDK, with lots of really nice features and tools to help you with your developing fun.  However some tasks are a little more difficult than you’d image. For instance, we wanted to stream an MP3 file [...]

Leave a Comment