私の目的は、view1
のボタンをクリックしたときに、UITableView
から選択したすべてのセルをにチェックインしました。 テーブルを次のビューに渡す前に、正しいトラックにいるかどうかをテストしたいと思いますが、そうではないようです。これは私のコードです:選択したすべてのセルの値を取得する
-(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);ショー?これは、テーブルビューの選択項目の数と同じですか? –