2012-01-10 50 views
0

我有這兩行代碼將文本加載到UITableViewCell中。UITableView cellForRowAtIndexPath,偏移陣列

NSDictionary *aTweet = [tweets objectAtIndex:[indexPath row]]; 
cell.textLabel.text = [aTweet objectForKey:@"from_user"]; 

我試圖抵消[indexPath行]所以它只開始填充第二小區,因爲我有一個自定義的UITableViewCell填補了第一個單元格。

回答

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"]; 
}