AirPic.Action.AirPlaySelectionViewController.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)
        {
            UITableViewCell cell = tableView.DequeueReusableCell (cellIdentifier);
            if (cell == null) {
                cell = new UITableViewCell (UITableViewCellStyle.Default, cellIdentifier);
                cell.ImageView.Image = icon;
            }

            var names = devices;
            try {
                var name = names [indexPath.Row];
                var device = AirPlayBrowser.GetDevice (name);
                cell.TextLabel.Text = device == null ? String.Empty : device.Name;
            }
            catch {
                // if we're unlucky
                return null;
            }
            return cell;
        }