【发布时间】:2014-10-07 17:06:28
【问题描述】:
我的控制台出现错误:
2009-05-30 20:17:05.801 ChuckFacts[1029:20b] *** -[笑话 isEqualToString:]:无法识别 选择器发送到实例 0x52e2f0
这是我认为错误来自的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Joke";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"TableCell" owner:self options:nil];
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero
reuseIdentifier:CellIdentifier] autorelease];
cell = tableCell;
}
NSString *jokeText = [jokes objectAtIndex:indexPath.row];
UILabel *jokeTextLabel = (UILabel*) [cell viewWithTag:1];
jokeTextLabel.text = jokeText;
NSString *dateText = formattedDateString;
UILabel *dateTextLabel = (UILabel*) [cell viewWithTag:2];
dateTextLabel.text = dateText;
[self todaysDate];
return cell;
}
“笑话”是一个充满笑话的数组,以防你需要知道
为什么会出现这个错误?
另外,您是否看到错误中显示的部分:
发送到实例 0x52e2f0
如何确定“0x52e2f0”是什么,以便下次更容易找到问题?
【问题讨论】:
标签: iphone objective-c cocoa exception