//IUITableViewDelegate Methods private void tableView(UITableView tableView) didSelectRowAtIndexPath(NSIndexPath indexPath) { OlympicCityTableViewCell cell = (OlympicCityTableViewCell)tableView.cellForRowAtIndexPath(indexPath); UIAlertView message = new UIAlertView withTitle("City Selected") message(cell.city.text) @delegate(null) cancelButtonTitle("OK") otherButtonTitles(null); message.show(); }
//IUITableViewDataSource Methods private UITableViewCell tableView(UITableView tableView) cellForRowAtIndexPath(NSIndexPath indexPath) { OlympicCityTableViewCell cell = tableView.dequeueReusableCellWithIdentifier("OlympicCityCell"); cell.city.text = dataArray[indexPath.row][0]; cell.country.text = dataArray[indexPath.row][1]; cell.gamesType.text = dataArray[indexPath.row][2]; cell.year.text = dataArray[indexPath.row][3]; cell.notes.text = dataArray[indexPath.row][4]; return(cell); }