My purpose is when the user click on a button in view1
(to go to the view2
), i will send all the selected cells from UITableView
just checked in view1
to the view2
.
So before passing the table to next view, i wanted to test if i am on the right track, but seems not. This is my code:
-(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]);
}
}
This always returning me a single 0.
2012-01-13 15:52:06.472 MyApp[876:11603] 0
Although i selected several items on the table.