Articles on objective-c

Jonah Williams

Jonah Williams

Multiple Environments in an iPhone Project

I’ve been following a Rails convention and defining multiple environments for my iPhone projects. This allows me to quickly switch application wide settings when running a test, development, or production version of the app.

Jonah Williams

Jonah Williams

Code Formatting in Xcode

Using Xcode 4? Take a look at Code Formatting in Xcode 4 Working in Xcode I almost forgot how much I like IntelliJ’s code formatting tools. Luckily for me Mike Smith recently pointed out that UniversalIndentGUI can be used to setup your own code formatting in Xcode.

Jonah Williams

Jonah Williams

Resizing views around the keyboard

Most of my iPhone apps need to accept keyboard input somewhere and that means I need to reposition my UI elements such that the keyboard does not hide the field the user is typing in. The iPhone Application Programming Guide offers one example of Moving Content That Is Located Under The Keyboard but this is

Jonah Williams

Jonah Williams

Loading UITableViewCells from a nib file

While working on iPhone applications I have found it useful to load as much of the UI layout and styling from nib files as possible. As a result I often want to load the cells for a table view from a nib file and created a factory class to handle this behavior every time I

Jonah Williams

Jonah Williams

iPhone gesture recognition

I recently needed to support some basic gesture recognition in an iPhone app. As it turns out this is a little bit tricky to do when the touches occur within the same responder chain as a view which already responds to touches (like a UIScrollView or UIWebView which might need to scroll or zoom in

Jonah Williams

Jonah Williams

Resizing UILabel to fit text

UILabels are often the most convenient way to display simple text in an iPhone app however I often want a label to display variable text which may need to wrap to multiple lines. Simply increasing the height of the UILabel doesn’t help because a single line of text will be centered vertically within the label’s