В моей - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
я первоначально имел:Почему мой UITableViewCellAccessoryCheckmark не отобразится?
if ([UploadManager isFileUploaded: filename])
cell.accessoryType = UITableViewCellAccessoryCheckmark;
else
cell.accessoryType = UITableViewCellAccessoryNone;
но, думая, что там может быть ошибка в моем UploadManager, я изменил его:
if ([UploadManager isFileUploaded: filename])
cell.accessoryType = UITableViewCellAccessoryCheckmark;
else
cell.accessoryType = UITableViewCellAccessoryCheckmark;
для тестирования. Однако мои ячейки STILL не показывают галочку. Что я делаю не так?!
Спасибо!
EDIT:
Это не имеет значения, но, на всякий случай, вот вся моя (большая часть) cellForIndexPath
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"fileList-cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault
reuseIdentifier: CellIdentifier];
}
int row = [indexPath row];
// Create cell layout
NSString *filename = [self.tableItems objectAtIndex: row];
// Name label
UILabel *nameLabel = (UILabel*)[cell viewWithTag: nameLabelTag];
if (nameLabel == nil)
{
nameLabel = [UILabel new];
// blah blah, snip
[cell addSubview: nameLabel];
}
nameLabel.text = filename;
[nameLabel sizeToFit];
CGRect rect = nameLabel.frame;
rect.origin.x = 50;
nameLabel.frame = rect;
// More UI added to cell here. Snip
// Is uploaded checkmark
if ([UploadManager isFileUploaded: filename])
cell.accessoryType = UITableViewCellAccessoryCheckmark;
else
cell.accessoryType = UITableViewCellAccessoryCheckmark;
return cell;
}
Пожалуйста, дайте все коды в - (UITableViewCell *) Tableview: (UITableView *) Tableview cellForRowAtIndexPath: (NSIndexPath *) indexPath, – Frozenna
Неисправность программиста, см. мой ответ ниже. Grrrr! – Olie