Я могу добавить текст к моим UITableView
, но когда я пытаюсь добавить к detailTextLabel
определенной строке, которая используется, чтобы быть NSDate
, приложение завершает работу и говорит:Не удается отобразить NSString в detailTextLabel
'NSInvalidArgumentException', reason: '-[__NSDate isEqualToString:]:
unrecognized selector sent to instance 0x8383690'
я могу добавьте обычный манекен NSString
в detailTextLabel
, так что я не понимаю его. Любая помощь?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
NSString* temp = [biggerDateA objectAtIndex:indexPath.row];
cell.textLabel.text = [bigA objectAtIndex:indexPath.row];
//cell.detailTextLabel.text = [biggerDateA objectAtIndex:indexPath.row];
//cell.detailTextLabel.text = @"Date Goes here";
cell.detailTextLabel.text = temp;
[bigA retain];
//[biggerDateA retain];
return cell;
}
«Строка, которая раньше была NSDate»? Что вы имеете в виду? – DrummerB
Какие объекты 'bigDateA' удерживают? Похож на объекты NSDate. И, конечно, вы не можете установить свойство 'text' в дату. – DrummerB
Вы уверены, что 'some string' имеет тип' string'? –