标签: objective-c iphone xcode
当我在tableview的第0部分选择一个单元格时,我总是首先被带到第1部分?
我认为这与我的'if'陈述有关...
代码:http://pastie.org/868523
提前致谢。
答案 0 :(得分:2)
您不会在该代码中的任何位置引用该部分。你需要做一些像
if(indexPath.section == 0) { //do section 0 loading } else if(indexPath.section == 1) { //do section 1 loading } //etc
否则,如果您单击任何部分的第四行,看起来您将匹配最后一个if语句,该语句将是推送的最后一个项目,因此也就是您看到的那个项目。