iPhone:从数组设置节标题 [英] iPhone: Setting section titles from an Array

查看:48
本文介绍了iPhone:从数组设置节标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个XML文件,两个节点,文本和标题.

I have an XML file, two nodes, text and title.

我正在尝试progrmatically从我建立的array设置节标题.

I'm trying to progrmatically set the section title from an array I've built up.

有没有一种方法可以执行以下操作(但是我不确定如何在项目行中输入内容?)

Is there a way I can do similar to the following (but I'm not sure how to bring in the item row?)

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return [arrySummaryTitle objectAtIndex:indexPath.row];  
}

您还如何通过Array设置栏目标题?

How else do you set the section title from an Array?

推荐答案

我一定误会了某些东西...您想使示例工作正常的是用return [arrySummaryTitle objectAtIndex:section];替换行,对吧? `

I must be misunderstanding something... What you'd want to make your example work is replace your line with return [arrySummaryTitle objectAtIndex:section];, right? `

这篇关于iPhone:从数组设置节标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆