我可以将文本添加到我的UITableView
,但是当我尝试添加到detailTextLabel
某个曾经是 a 的字符串时,NSDate
应用程序崩溃并显示:
'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;
}