셀이있는 표가 있습니다. 셀 내에서 선택기보기가tableView 셀 스위프트에 데이터 전달
지금은 내가 피커보기
에서 데이터를 표시 할 수있는 테이블 뷰 셀에 부모 컨트롤러에서 데이터 (객체의 배열)을 전달하려는var foodServings:[FoodUnit]=[]
func tableView(tableView:UITableView, cellForRowAtIndexPath indexPath:NSIndexPath)->UITableViewCell{
let cell = tableView.dequeueReusableCellWithIdentifier("recipeIngredientCell",forIndexPath: indexPath) as! ReceiptIngredientsViewCell
let row = indexPath.row
cell.ingredientName.text = foods[row].name
cell.ingredientText.text = foodQuantities[row]
// cell.foodServings = self.foodServings
return cell
}
데이터를 셀로 보낼 수 있지만이 작업이 필요하지 않았 으면합니다. 와
Thats how the table is constructed
:
내가 그것을 조금 clearify하려고
cell.ingredientName.text = foods[row].name
cell.ingredientText.text = foodQuantities[row]
나는 텍스트 뷰에서 예를 들어 콩에 대한 셀 라벨과 텍스트에 액세스 할 수 있습니다를
그러나 피커 뷰를 채울 수 있도록 각 셀에 데이터 배열을 보내야 피커 뷰를 채울 수 있습니다.
실제로 할 수 있고 사용한 방식이 정확합니다. 무엇이 문제입니다? –
이 경우, 예, 그렇다면 어떻게 데이터를 테이블 뷰 셀로 전달할 수 있습니까? –