按日期条件对 UItableView 部分进行排序
将 myArray (NSMutableArray
) 作为带有事件的 dataSource
自定义表部分是:
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
customSections = [[NSMutableArray alloc] init];
//My custom sections
[customSections addObject:@"now"];
[customSections addObject:@"in this day"];
NSString *sectionText = [customSections objectAtIndex:section];
return sectionText;
}
缩短它们的最佳实践是什么? 对于每个事件,我都有一个开始时间和结束时间
Having myArray (NSMutableArray
) as dataSource
with events
And the custom table sections are:
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
customSections = [[NSMutableArray alloc] init];
//My custom sections
[customSections addObject:@"now"];
[customSections addObject:@"in this day"];
NSString *sectionText = [customSections objectAtIndex:section];
return sectionText;
}
What's the best practice to short them?
for each event I have a start time and end time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在另一个地方初始化并填充您的 customSections 数组(例如,当您初始化此类时)。比你必须做这样的事情:
You should initialize and fill in your customSections array somewhere in another place (for example when you initializing this class). Than you have to do something like this: