0

mainviewボタン(id 1)をクリックすると、mainViewにボタンがあります。nextViewを呼び出すアクション[secondview have tableView]tableViewセルの最初の行が選択または強調表示された状態。その状態は選択済みに設定されます。

-(IBAction)btnOneClicked:(id)sender
{
    SecondView *nextView = [[SecondView alloc] initWithNibName:@"SecondView" bundle:nil];
    [self.navigationController pushViewController:SecondView animated:YES];
    NSIndexPath* selectedCellIndexPath= [NSIndexPath indexPathForRow:0 inSection:0];
    [nextView tableView:nextView.firstTable didSelectRowAtIndexPath:selectedCellIndexPath];
}

私のボタンアクションメソッドを見ることができます。私は多くのオプションを試しましたが、成功しませんでした。これを手伝ってください。

4

2 に答える 2

2

tableView:didSelectRowAtIndex:実際には、行を選択したときに呼び出されるデリゲートメソッドです。

行を選択するには、を呼び出す必要があります

[nextView.firstTable selectRowAtIndexPath:selectedCellIndexPath animated:YES scrollPosition:UITableViewScrollPositionTop]
于 2013-02-07T12:34:49.700 に答える
0

以下のコードを試してください

[button_refresh addTarget:<instance where you want to implement the method> action:@selector(refreshContent:) forControlEvents:UIControlEventTouchUpInside];

それがあなたを助けることを願っています。

于 2013-02-07T13:12:04.907 に答える