iPhone: Setting section titles from an Array

微笑、不失礼 提交于 2019-12-08 15:22:38

问题


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

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];  
}

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


回答1:


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



来源:https://stackoverflow.com/questions/8270500/iphone-setting-section-titles-from-an-array

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!