我有这两行代码将文本加载到UITableViewCell。
NSDictionary *aTweet = [tweets objectAtIndex:[indexPath row]];
cell.textLabel.text = [aTweet objectForKey:@"from_user"];
我试图偏移[indexPath行],所以它只开始填充第二个Cell,因为我有一个自定义UITableViewCell填充第一个Cell。
答案 0 :(得分:0)
为什么不直接测试行号并使用相应的代码,如下所示:
if ([indexPath row] == 0) {
// take care of the first row
}
else {
NSDictionary *aTweet = [tweets objectAtIndex:[indexPath row]-1];
cell.textLabel.text = [aTweet objectForKey:@"from_user"];
}