Tutorials

Below you will find some iPhone programming tutorials, and some tips and tricks on how to do things which may not be so obvious. Useful for both the beginner and experienced coder.

Handy debug macro

I’ve seen a few different versions of this, so today I’ll post what I use to help me debug code execution order and debug info. The code gets removed for non-debug builds, and you’ll have to define DEBUG in your debug build settings. Here it is: #if DEBUG==1 #define AGLog(format, …) NSLog(@”%s:%@”, __PRETTY_FUNCTION__,[NSString stringWithFormat:format, ## [...]

Adding a UITableView to a custom UIViewController

On my last tutorial post I demonstrated how one would add a UIToolbar to a UITableViewController for the case where you would want a UITableViewController to be the main view, rather than embedding a UITableView in a custom UIViewController. I will now explain how to do the opposite, which is embedding a UITableView in your [...]

Adding a UIToolbar on a UITableViewController

In one of my current iPhone projects I have the need to add a UIToolbar on a UITableViewController to add some features that apply to the current item being viewed. I decided to use a UITableViewController instead of rolling out a custom view for a couple of reasons. The item being viewed has several sections, [...]