我想返回NSString大写字母的第一个字母。我有一个UISearchDisplayController根据搜索结果的标题显示部分标题。
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
NSString *sectionTitle;
if (searching)
sectionTitle = [searchSectionTitles objectAtIndex:section];
else
sectionTitle = [[collation sectionTitles] objectAtIndex:section];
return sectionTitle;
}
并在我的搜索功能中返回这封信,
[searchSectionTitles addObject:[lastName firstLetter]];
我该怎么做
- (NSString *)firstLetter
返回 a 的第一个字母NSString?