【发布时间】:2014-08-15 08:04:44
【问题描述】:
我尝试按客户姓名的第一个字符对我的UITableView 进行分组。我使用 MagicalRecords 作为助手,因为我从数据库中获取数据。
我所拥有的看起来像这样:
self.dataSource.resultsController = [Customer fetchAllGroupedBy:nil withPredicate:nil sortedBy:@"lastName,firstName" ascending:YES delegate:self.dataSource];
我想将fetchAllGroupedBy:nil 替换为有点像fetchAllGroupedBy:@"lastName.firstChararcter"
我已经尝试过fetchAllGroupedBy:@"[lastname substringWithRange:[NSMakeRange(0, 1)],但这不起作用。
我现在的问题是,这是否可能?如果可以,怎么做?
任何帮助表示赞赏。
【问题讨论】:
标签: ios uitableview core-data magicalrecord