我的目的是当view1
上的一个按钮,用户点击(去view2
),我将所有选中的单元发送从UITableView
刚刚签入view1
到view2
。 因此,在将表格传递到下一个视图之前,我想测试我是否处于正确的轨道上,但似乎不是。这是我的代码:让所有选中的单元格值
-(IBAction)goToView2{
//get all section selectioned items into an array
themesChosed=[tView indexPathsForSelectedRows];//tView is the outlet of my UITableView and themesChosed is an NSArray declared in the .h file
for (int i=0; i<=[themesChosed count]; i++) {
NSLog(@"%i",[[themesChosed objectAtIndex:i]integerValue]);
}
}
这总是返回我一个0
2012-01-13 15:52:06.472 MyApp[876:11603] 0
虽然我选择了在桌子上的几个项目。
什么的NSLog( @“%d”,themesChosed.count);显示?这是否与tableview中选定项目的数量相同? – 2012-01-13 16:50:34