读取 UITableView 部分标题的字符串值
我想将 UITableView 的部分标题推送到另一个视图控制器的部分标题。 但我无法找到阅读现有章节标题的方法。现有的部分标题是动态构造的,我宁愿重用它也不愿再次重建它。
if (indexPath.section == 0) {
SecondViewController *secondViewController = [[SecondViewController alloc] init];
secondViewController.strValueHolder = FOO_section.sectionTitle; // FOO Code
[[self navigationController] pushViewController:secondViewController animated:YES];
[secondViewController release];
}
I want to push the section title of a UITableView to another view controller's section title.
But I can't figure out a way to read an existing section title. The existing section title is dynamically constructed and I'd rather reuse it than reconstructing it again.
if (indexPath.section == 0) {
SecondViewController *secondViewController = [[SecondViewController alloc] init];
secondViewController.strValueHolder = FOO_section.sectionTitle; // FOO Code
[[self navigationController] pushViewController:secondViewController animated:YES];
[secondViewController release];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以直接调用 titleForHeaderInSection 方法:
或者将 titleForHeaderInSection 中当前的代码移动到自定义方法,并从 titleForHeaderInSection 和您推送另一个视图控制器的位置调用该自定义方法。
You can call the titleForHeaderInSection method directly:
or move the code you currently have in titleForHeaderInSection to a custom method and call that custom method from titleForHeaderInSection and the place where you are pushing another view controller.