Voices That Matter

Cocoa

iPhone Developer Tips Stats:
Past 30 days - Pageviews: 88,766 Visitors: 61,679
Thank you everyone! Let's shoot for 100,000 by May. Pass it on...



Launching Other Apps within an iPhone Application (Part 2)

To continue on the types of URL Schemes that are supported by the iPhone (see Part 1); today I will show you how to:

Launch YouTube
“Deep Link” to content in iTunes

Cocoa

How to Mask an Image

Masking an image enables a developer to create images with irregular shapes dynamically. Masking is often used to create a user interface that is more compelling and less boring.
Take for example the following example …

Cocoa

Date Formatter Examples – Take 3: Date from String

While working on an iPhone application recently, I needed to convert a date read from an XML stream that was in the following format: 20081122 to a nicely formatted string for display on the device: Saturday November 22, 2008.

Cocoa, Date and Time

“Default.png” the secret of the load screen …

Ever wondered how all of the applications on your iPhone seem to show a loading screen or “boilerplate” as soon as the icon is touched and wondered how they get the image to appear quickly? Well the secret is in the presence of a file in your application called Default.png.

Cocoa

Date Formatter Examples – Take 2: Format Strings

In the first post on working with dates several of the examples use the “old style” date format syntax. The examples work, however, I want to show an additional example that uses the ICU (International Components for Unicode) library for format strings.

Cocoa, Date and Time

How to “unfreeze” your iPhone Application

Have you ever found yourself stumped because your application locks up but doesn’t seem to crash or in any other way indicate that there is an error? If you have, then you are likely the victim of a common problem that can occur when you attempt to make certain changes to the UI outside [...]

Cocoa

Date Formatter Examples – Take 1: NSDateFormatter

Sometimes all you’re really looking for is a basic chunk of code to get something done. For example, I was working on an application yesterday and needed to display the current date in text format: October 29, 2008. A simple concept for sure, however, with the many nuances of date formatters, it takes some time [...]

Cocoa, Date and Time

How to Prevent iPhone from Sleeping

The automatic sleep timer is one of the ways the iPhone saves power. If the screen isn’t touched for a certain amount of time, it dims the screen and eventually turns it off. Although you should leave the timer on, there are times when this is not what you want (games are a good example). [...]

Cocoa

How to Get Width of UIString in a Specific Font

If you’ve ever been frustrated trying to find a way to compute the height of a string that wraps you will know my pain. Recently, I discovered that UIKit has made some addition to the NSString class that adds pure magic to the string type. If you lookup the NSString class in the [...]

Cocoa

Launching Other Apps within an iPhone Application

In an earlier post I talked about how to launch the browser from within an iPhone application using the UIApplciation:openURL: method.
It is also possible to use this same technique to launch other applications on the iPhone that are very useful.
Examples of some of the key applications that you can launch via URL are:

Launch the Browser [...]

Cocoa

JSON Framework for iPhone (Part 2)

Editor’s Note: Due to the popularity of this iPhone JSON series, a new three part tutorial series on working with JSON was published in August 2009. You can find the latest JSON iPhone tutorial series at the links below:

iPhone JSON and Flickr Tutorial – Part 1
iPhone JSON and Flickr Tutorial – Part 2
iPhone JSON and [...]

Cocoa

Understanding Reload, Repaint, and Re-Layout for UITableView

Leaning the Objective-C language isn’t that bad; the true hurdle in learning to develop for iPhone is in understanding the frameworks. UITableView and UITableViewController is a perfect example of how a developer, new to iPhone, can get lost in a quagmire of documentation. Most recently I found my self looking for a way [...]

Cocoa

A Java Developer’s Guide to Threads on iPhone

Java makes it ridiculously simple to run code in threads and ensure that your objects are thread safe. When developing user experiences, threads enable you to do things in the “background” (like downloading and parsing content) without rendering your application unresponsive and giving the user the sense that the application may have “frozen”. [...]

Cocoa, Objective-C

Launching the Browser from within an iPhone application

It is sometimes nice to be able to launch a browser from within your applications. Though not as elegant as the use of a UIWebView, it is much easier.
NOTE Because it is possible for an application to bind itself to a URL (like Google Maps), this technique can also be used to launch other [...]

Cocoa

How to download and process GZip’d data

HTML browsers, for the longest time, have had support for downloading and expanding Gzip content. This is an ideal way to compress the size of HTML pages because gzip is at its best when compressing text. As you can imagine, compression is even more critical when we look at consuming XML over the [...]

Cocoa