标题几乎询问了这一切。我一直回来尝试每隔几天实施一次,但是我似乎无法使它起作用。我假设在ViewDidload中设置了从启动中设置lettaitem的代码,但是在这一点上,我毫无头绪。

任何帮助是极大的赞赏。

- 泰勒

有帮助吗?

解决方案

您可以使用 selectRowAtIndexPath 代表:

[tblMyTable selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:0];

当然,更换 [NSIndexPath indexPathForRow:0 inSection:0] 使用要自动设置的部分 /行。

你可以把它放在你的 viewDidLoad 或者 viewWillAppear: 代表。

另外,请确保您定义您的 tblMyTable (或任何您命名的桌子) 在您的标题中,通过接口构建器将其连接起来 (如果您使用自定义XIB), ,并使用 @synthesize 在你的 .m

didSelectRowAtIndex: 当您使用该方法时,应该称呼为 didSelectRowAtIndex, ,你应该很好。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top