我有一个简单的问题。
我对多个问题和答案使用 NSMutableArray。我已将所有数据放在 tableView 中,并将所选行的数据放在标签中。现在,我如何使用按钮从下一行获取数据?认为我需要这样的东西:
   question.text = [questions objectAtIndex:indexPath.row+1];
但是放在哪里呢?如果我在 cellForRowAtIndexPath 方法之外使用这一行,它将不接受 indexPath。
我确信有比这更简单的方法,但用弗兰克辛纳屈的话来说:这是我的方式。:-)
这是完整的方法:
- (NSInteger)tableView : (UITableView *)tableView numberOfRowsInSection:(NSInteger)section
     {
return [questions count];
 }
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: 
   (NSIndexPath *)indexPath
 {
static NSString *simpleTableIdentifier = @"questionCell";
UITableViewCell *cell = [questionTableView   
 dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil) {
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 
  reuseIdentifier:simpleTableIdentifier];
}
if ([content.text isEqualToString:@"Unfallverhütung"]) {
    question.text = [questions objectAtIndex:indexPath.row];
}
return cell;
}
question是我的标签的名称。
questions是数组的名称。
我很感激任何建议。
谢谢