Ian Vink
Ian Vink

Reputation: 68830

MonoTouch.Dialog: AccessoryViews

I need to put a check beside a certain row, but when using this override of course I get the below warning. Where in MonoTouch.Dialog do I then enable a check?

public override UITableViewCellAccessory AccessoryForRow (UITableView tableView, NSIndexPath indexPath)
{       
  return UITableViewCellAccessory.Checkmark; (For a row of course, simplified here)
}

WARNING: Using legacy cell layout due to delegate implementation of tableView:accessoryTypeForRowWithIndexPath: in Please remove your implementation of this method and set the cell properties accessoryType and/or editingAccessoryType to move to the new cell layout behavior.

Upvotes: 1

Views: 1259

Answers (1)

miguel.de.icaza
miguel.de.icaza

Reputation: 32694

This method is deprecated, and instead if you need to use this, you need to configure your UITableViewCells accordingly by setting the AccessoryType and AccessoryView properties on it.

Just create a new Element class that implements the behavior you need, check my recent blog on patterns for building Elements:

http://tirania.org/monomac/archive/2011/Jan-18.html

Upvotes: 2

Related Questions