0
iPhone 용 Xcode 5 사용.
MVC (로컬 배열 아님)의 array
에서 tableview
의 데이터를 표시하려고합니다. 그러나 데이터가 테이블에 표시되지 않고 빈 그리드로 나타납니다. storyboard
(펜촉 없음) 및 custom cell
(TableViewController 아님)을 사용하고 있습니다.
내가 누락 된 부분을 알려 주실 수 있습니까? 미리 감사
의 코드는 다음과 같습니다스토리 보드 및 맞춤형 셀의 MVC 배열에있는 테이블에 데이터가 표시되지 않습니다.
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection: (NSInteger)section {
NSLog (@"array count is %i", listRecipes.recipeArray.count);
return [listRecipes.recipeArray count];
}
또한
-(UITableViewCell)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString cellIdentifier = @"ListCellIdentifier";
MYCustomListCell* listCell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
NSString* dataString = listRecipes.recipeArray[indexPath.row];
listCell.listName.text = dataString;
listCell.imageView.image = [UIImage imageNamed:dataString];
return listCell;
}
도움이 될만한 코드를 보여주십시오. – Larme
listRecipes.recipeArray.count는 무엇을 반환합니까? 0이 아닌가요? – rdelmar
이것은 0을 출력합니다 : NSLog (@ "배열 개수는 % i", listRecipes.recipeArray.count); – ici