Add Arrows to rows

August 1, 2008    Intro Programming

I found a something a bit late what would of been nice to cover before. I guess it is better late then never right?

In offical IPhone apps there are arrows on each row you can click on that mean you can click here to users. We want to add these nice little arrows.

So open up RootViewController.m and look for the function cellForRowAtIndexPath and in the if (cell == nil) {} block you want to add a link for accessoryType so it looks like

if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }

Your lists should now look like

No source code for this since it was just a one line change



comments powered by Disqus