我有一个基于视图的应用程序,我正在添加一个表视图作为主视图的子视图。我使用了UITableViewDelegate来响应表格方法。一切正常,但我想选择第一行或UITableView作为默认选择(突出显示)。
请帮助我,我需要什么代码,我需要把它放在哪里。
发布于 2012-01-05 21:58:33
- (void)viewWillAppear:(BOOL)animated
    {
       [super viewWillAppear:animated];
     // assuming you had the table view wired to IBOutlet myTableView
        // and that you wanted to select the first item in the first section
        [myTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:0];
    }https://stackoverflow.com/questions/2728152
复制相似问题