我需要你的幫助。我需要動態插入數據,但插入應該來自iPhone的tableview中的第二行。我可以這樣做。如何在iPhone的tableview中插入數據從第二行到iphone
0
A
回答
1
您可能想獲取從陣列WRT(indexPath.row -1)的數據,如果你正在使用數組填充表
1
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.row==0)
{
//return blank cell;
}
//add cell contents
return cell;
}
+0
我這樣做,但有一個問題,只要我插入我的數組,然後插入從0索引開始。 – Nitin 2011-02-23 08:32:57
+0
使用[array objectAtIndex:indexPath.row-1] – KingofBliss 2011-02-23 08:34:30
0
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell.
NSIndexPath *path1 = [NSIndexPath indexPathForRow:indexPath.row+1 inSection:indexPath.section];
[self configureCell:cell atIndexPath:path1];
return cell;
}
我沒有測試它,但它應該工作,試試吧
相關問題
- 1. iphone-的tableview號插入
- 2. 如何在iPhone中插入數據到SQLite數據庫
- 3. 如何在iphone中的tableview的每一行添加標籤iphone
- 4. 從iPhone的核心數據在tableview中逐個添加單行
- 5. 如何以編程方式將數據從iphone插入到mysql
- 6. 在TableView中的iPhone TableView
- 7. 如何在iphone中插入數據(sqlite數據庫)sdk
- 8. iPhone的TableView數據到2節
- 9. 如何在iphone中的sqlite數據庫中插入圖像
- 10. 在tableview中顯示數據json iphone
- 11. iPhone中的TableView
- 12. 從viewdidload插入到tableview中的行
- 13. 如何在iPhone中將解析數組數據插入到sqlite數據庫
- 14. 將行插入tableview中的部分dynmically iphone
- 15. 插入值從第一個數據庫到第二條款
- 16. 如何在iphone上添加數據到TableView?
- 17. 如何插入'?' (問號)從iPhone SDK的SQLite數據庫
- 18. 使用iPhone中的數據庫寫入數據到iPhone
- 19. iPhone SDK:在TableView中
- 20. iPhone App Dev - 更改TableView中的行數
- 21. 如何在我的sqlite數據庫中一次插入多行sqlite中的iPhone
- 22. IPAD vs Iphone TableView行
- 23. 16秒在iPhone上的SQLite數據庫中插入1000行?
- 24. 在iPhone的外部數據庫中插入新行
- 25. 從TableView中獲取數據並插入到數據庫中
- 26. 在Ultralite數據庫中插入二進制數據時出現錯誤iPhone
- 27. 如何從不同的類中將新行插入到tableview中?
- 28. Iphone Tableview reaload數據如何使新數據在桌面視圖的頂部行
- 29. 如何將iPhone的數據庫文件從iPhone導出到MAC?
- 30. 插入語句在運行時執行但數據未插入到數據庫中iPhone
試着接受你以前的問題的答案 – KingofBliss 2011-02-23 08:20:35