【发布时间】:2014-07-07 23:30:48
【问题描述】:
我想创建一个时区列表。 但是我在 timeZone.abbreviation 得到了以下错误。
-[__NSCFString abbreviation]:无法识别的选择器发送到实例 0x19cb80b0
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
// Configure the cell...
NSTimeZone *timeZone = [[NSTimeZone knownTimeZoneNames] objectAtIndex:indexPath.row];
cell.textLabel.text = timeZone.abbreviation; // <- Error Here
cell.detailTextLabel.text = timeZone.description;
cell.accessoryType = (timeZone == self.timeZone)? UITableViewCellAccessoryCheckmark :UITableViewCellAccessoryNone;
return cell;
}
我尝试在互联网上搜索,但目前找不到解决方案。 请给我一些建议。 提前致谢。
【问题讨论】:
标签: ios uitableview nstimezone