我正在尝试在单个UIViewController中提供两个不同的表。我正在采取configureCellForTable ...异常,当单元格为零时总是如此。但我不明白哪一行会产生异常。
我的示例代码如下;
static NSString *cellIdentifier = @"creditCardItemCell";
CreditCardItemTableViewCell *cell;
if(tableView == _creditCardsTableView)
cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(tableView == _otherPaymentMethodsTableView)
cell = [tableView dequeueReusableCellWithIdentifier:@"paymentItemCell"];
提前致谢
答案 0 :(得分:0)
Multipul tableview在单个UIViewController中管理。但是所有tableview单元格标识必须是唯一的。要管理每个tavleview以使用以下代码...
function MyController($scope) {
$scope.currentPage = 1;
$scope.pageSize = 10;
$scope.meals = [];
var dishes = [
'noodles',
'sausage',
'beans on toast',
'cheeseburger',
'battered mars bar',
'crisp butty',
'yorkshire pudding',
'wiener schnitzel',
'sauerkraut mit ei',
'salad',
'onion soup',
'bak choi',
'avacado maki'
];
var sides = [
'with chips',
'a la king',
'drizzled with cheese sauce',
'with a side salad',
'on toast',
'with ketchup',
'on a bed of cabbage',
'wrapped in streaky bacon',
'on a stick with cheese',
'in pitta bread'
];
for (var i = 1; i <= 100; i++) {
var dish = dishes[Math.floor(Math.random() * dishes.length)];
var side = sides[Math.floor(Math.random() * sides.length)];
$scope.meals.push('meal ' + i + ': ' + dish + ' ' + side);
}
$scope.pageChangeHandler = function(num) {
console.log('meals page changed to ' + num);
};
}