CandySearch.CandyTableViewController.GetCell C# (CSharp) Method

GetCell() public method

public GetCell ( UITableView tableView, NSIndexPath indexPath ) : UITableViewCell
tableView UITableView
indexPath NSIndexPath
return UITableViewCell
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) {
            var cellId = "CandyCell";
            var cell = tableView.DequeueReusableCell(cellId);
            if (cell == null) {
                cell = new UITableViewCell(UITableViewCellStyle.Default, cellId) {
                    Accessory = UITableViewCellAccessory.DisclosureIndicator
                };
            }
            var candy = tableView == searchDisplayController.SearchResultsTableView ? filteredCandies[indexPath.Row] : candies[indexPath.Row];
            cell.TextLabel.Text = candy.Name;
            return cell;
        }