Archive for November, 2008
iPhone Developer Tips Stats:
|
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.
Alert with TextFields
Note: Although applications in the App Store have used this approach, Apple has also rejected applications that use this technique as it does access private APIs.
In a recent discussion with the UI designers for an upcoming iPhone application, I was asked if it’s possible to create an Alert that would overlay the splash screen, prompting [...]
“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.
Available Fonts on the iPhone
I was recently asked about support for fonts on the iPhone. Surprisingly, the list of fonts is quite comprehensive. To give you an idea of the available fonts, I’ve written a simple application to dump the font information to the console inside Xcode.
Yet Another Debug Output (NSLog Replacement)
Although NSlog is convenient for outputting messages to the console, I tire of the date/time and object information that it prints.
As an alternative, one can craft a macro that uses CFShow, which outputs Core Foundation objects to stderr. CFShow uses callbacks to objects to display their descriptions, which allows one to use “%@” like [...]
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.
CGRect, CGSize and CGPoint Functions
With an understanding of C structures, and the definitions of CGRect, CGSize and CGPoint behind us, let’s look at a handful of functions for working with these structures.
C++ on iPhone: Part 3, Run Time Type Identification
In this third article on C++ programming on the iPhone platform, I will be covering RTTI, or Run Time Type Identification. This C++ language feature is often unsupported on mobile platforms due to the usual "code bloat" reasons. So, let’s take a look at the iPhone and see what it has to offer.
CGRect, CGSize and CGPoint
Digging into development of iPhone applications, you’ll eventually encounter references to CGRect, CGSize, and CGPoint. These references are to C structures (see this post for more information on structures). This post will provide a high-level view of what comprises CGRect and its counterparts. Here is how CGRect is defined:
C Structures
Leading up to a post on working with CGRect, CGPoint and CGSize, it makes sense to visit C structures. A structure is a collection of variables, grouped together to facilitate organization of data. For example, one might define a set of x and y coordinates as follows:
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 [...]








