I'm implementing the Table Swipe menu using the component SWTableViewCell, in VisualStudio (Xamario.iOS). Below is my code for the method "GetCell"
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)`<br/>
{
SWTableViewCell.SWTableViewCell cell = null;
cell = (SWTableViewCell.SWTableViewCell)tableView.DequeueReusableCell(cellIdentifier);
if (cell == null)
cell = new SWTableViewCell.SWTableViewCell(UITableViewCellStyle.Subtitle, cellIdentifier);
cell.SetRightUtilityButtons(GetButtons(), 30.5f);
cell.Delegate = new SWTableViewCell.SWTableViewCellDelegate();
cell.TextLabel.Text = tableItems[indexPath.Row];
}
private UIButton[] GetButtons()
{
UIButton[] buttons = new UIButton[1];
UIButton btn = new UIButton();
btn.SetTitle("Delete", UIControlState.Normal);
buttons[0] = btn;
UIImage image = UIImage.FromFile("Profile/Images/house");
btn.SetImage(image, UIControlState.Normal);
return buttons;
}
I do not get any exception in these methods but after all these I'm getting the exception at the line UIApplication.Main(args, null, "AppDelegate") in Main method.
NSInvalidArgumentException Reason: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
If I skip the line "SetRightUtilityButtons", I'm getting all the rows without any problem. But I would like to have slider kind of menu.