Relaying Actions from UITableViewCells

Sometimes, it is useful to add a UIControl or one of its subclasses, like a UIButton, to a UITableViewCell. For instance, we want users to be able to tap the thumbnail image in a cell and see a full-size image for that item. In this section, we’ll do that by adding a clear button on top of the thumbnail. Tapping this button will show the full-size image in a UIPopoverController when the application is running on an iPad.

Open HomepwnerItemCell.xib and drag a UIButton on top of the UIImageView that is already there. Resize this button to match the exact width and height of the UIImageView.

Then, Option-click on HomepwnerItemCell.h to open it in the assistant editor. Control-drag from the button to the method ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.