Ios 带有多(+;10)个自定义UITableView单元格的UITableView

Ios 带有多(+;10)个自定义UITableView单元格的UITableView,ios,uitableview,uiscrollview,Ios,Uitableview,Uiscrollview,我有一个关于编码风格的问题。 在详细视图中(图像参考如下) 将UITableView应用于整个页面,并为每行添加自定义UITableViewCell(此设计可能为每行添加12个自定义UITableViewCell) -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if(indexPath.row == 0){ load

我有一个关于编码风格的问题。 在详细视图中(图像参考如下)

将UITableView应用于整个页面,并为每行添加自定义UITableViewCell(此设计可能为每行添加12个自定义UITableViewCell)

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{  
  if(indexPath.row == 0){
    load custom cell for row 0 ( which is image)
  } else if(indexPath.row == 1){
     load custom cell for row 1 ( which is text and graph)

 }  else if(indexPath.row == 2){
      load custom cell for row 2 ( which is UICollectionview)

  }  else if(indexPath.row == 3){
      load custom cell for row 3 ( which is UIScrollview with images)

  } else if(indexPath.row == 4){
     load custom cell for row 4 ( which is UIPicker or anything else)

  }//and so on until indexPath.row == 11
}
这真的是在这个控制器中实现多自定义UITableView的正确方法吗?你必须再次在DidSelectRowAtPath中实现if-else。就个人而言,代码multiple if-else看起来很奇怪,UITableView的概念就是为此而设计的。UIScrollview呢

从理论上讲,这看起来很有希望与出列的东西,这使这个细节控制器非常有效的内存?我只是想学习正确的方法使用UITableView。如果大多数人这样做,我必须接受它,并使用它


谢谢

简单回答-是!简单回答-是!