UITableView sections are not ordered as expected

前端 未结 1 1472
醉酒成梦
醉酒成梦 2021-01-26 02:01

I am using a tableView with customised section titles. The core data objects are shown on a precise section depending on the value from a transient attribute called sectionIdent

相关标签:
1条回答
  • 2021-01-26 03:04

    you sort only based on due Date and name so the category with the oldest entry comes first.

    the entries would have to be sorted based on your sectionIdentifier first

    NSSortDescriptor *sortDescriptor0 = [[NSSortDescriptor alloc]initWithKey:@"sectionIdentifier" ascending:YES];
    NSSortDescriptor *sortDescriptor1 = [[NSSortDescriptor alloc]initWithKey:@"todoDueDate" ascending:YES];
    NSSortDescriptor *sortDescriptor2 = [[NSSortDescriptor alloc]initWithKey:@"todoName" ascending:YES];
    
    0 讨论(0)
提交回复
热议问题